Tri-Inspector/Editor.Extras/Processors/HideInPlayModeProcessor.cs
2022-01-07 18:40:32 +03:00

25 lines
724 B
C#

using TriInspector.Processors;
using TriInspector;
using UnityEngine;
[assembly: RegisterTriPropertyHideProcessor(typeof(HideInPlayModeProcessor))]
[assembly: RegisterTriPropertyHideProcessor(typeof(ShowInPlayModeProcessor))]
namespace TriInspector.Processors
{
public class HideInPlayModeProcessor : TriPropertyHideProcessor<HideInPlayModeAttribute>
{
public override bool IsHidden(TriProperty property)
{
return Application.isPlaying;
}
}
public class ShowInPlayModeProcessor : TriPropertyHideProcessor<ShowInPlayModeAttribute>
{
public override bool IsHidden(TriProperty property)
{
return !Application.isPlaying;
}
}
}