lucid-super-dream/Assets/Utils/Editor/SerialVarEditor.cs

24 lines
522 B
C#
Raw Normal View History

2021-01-04 17:49:48 +01:00
using UnityEditor;
namespace Ktyl.Util
{
public abstract class SerialVarEditor<T> : Editor
{
private SerialVar<T> _t;
protected virtual void OnEnable()
{
_t = target as SerialVar<T>;
}
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.LabelField("Current Value", _t.Value.ToString());
EditorGUI.EndDisabledGroup();
}
}
}