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

25 lines
755 B
C#
Raw Normal View History

2022-01-07 10:40:32 -05:00
using TriInspector.Processors;
using TriInspector;
using UnityEngine;
[assembly: RegisterTriPropertyDisableProcessor(typeof(DisableInPlayModeProcessor))]
[assembly: RegisterTriPropertyDisableProcessor(typeof(EnableInPlayModeProcessor))]
2022-01-07 10:40:32 -05:00
namespace TriInspector.Processors
{
public class DisableInPlayModeProcessor : TriPropertyDisableProcessor<DisableInPlayModeAttribute>
{
public override bool IsDisabled(TriProperty property)
{
return Application.isPlaying;
}
}
public class EnableInPlayModeProcessor : TriPropertyDisableProcessor<EnableInPlayModeAttribute>
{
public override bool IsDisabled(TriProperty property)
{
return !Application.isPlaying;
}
}
}