unity-atoms/Source/Editor/Editors/Events/IntEventEditor.cs
2019-09-30 00:02:54 +02:00

21 lines
604 B
C#

#if UNITY_2019_1_OR_NEWER
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor.UIElements;
namespace UnityAtoms.Editor
{
[CustomEditor(typeof(IntEvent))]
public sealed class IntEventEditor : AtomEventEditor<int, IntEvent>
{
protected override VisualElement GetRaiseValueInput()
{
var input = new Toggle() { label = "Raise value", name = "Raise value", viewDataKey = "Raise value" };
input.RegisterCallback<ChangeEvent<int>>((evt) => { _raiseValue = evt.newValue; });
return input;
}
}
}
#endif