Tri-Inspector/Editor.Extras/Processors/DisableInEditModeProcessor.cs

25 lines
755 B
C#
Raw Normal View History

using TriInspector.Processors;
using TriInspector;
using UnityEngine;
[assembly: RegisterTriPropertyDisableProcessor(typeof(DisableInEditModeProcessor))]
[assembly: RegisterTriPropertyDisableProcessor(typeof(EnableInEditModeProcessor))]
namespace TriInspector.Processors
{
public class DisableInEditModeProcessor : TriPropertyDisableProcessor<DisableInEditModeAttribute>
{
public override bool IsDisabled(TriProperty property)
{
return !Application.isPlaying;
}
}
public class EnableInEditModeProcessor : TriPropertyDisableProcessor<EnableInEditModeAttribute>
{
public override bool IsDisabled(TriProperty property)
{
return Application.isPlaying;
}
}
}