mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 16:28:23 -05:00
25 lines
755 B
C#
25 lines
755 B
C#
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|