2019-10-01 23:45:42 +02:00
#if UNITY_2019_1_OR_NEWER
using UnityEditor ;
using UnityEngine.UIElements ;
2019-10-15 22:39:20 +02:00
using UnityAtoms.SceneMgmt ;
2019-10-01 23:45:42 +02:00
using UnityAtoms.Editor ;
namespace UnityAtoms.SceneMgmt.Editor
{
2019-10-15 22:39:20 +02:00
/// <summary>
/// Event property drawer of type `SceneField`. Inherits from `AtomEventEditor<SceneField, SceneFieldEvent>`. Only availble in `UNITY_2019_1_OR_NEWER`.
/// </summary>
2019-10-01 23:45:42 +02:00
[CustomEditor(typeof(SceneFieldEvent))]
public sealed class SceneFieldEventEditor : AtomEventEditor < SceneField , SceneFieldEvent >
{
protected override VisualElement GetRaiseValueInput ( )
{
var input = new Toggle ( ) { label = "Raise value" , name = "Raise value" , viewDataKey = "Raise value" } ;
input . RegisterCallback < ChangeEvent < SceneField > > ( ( evt ) = > { _raiseValue = evt . newValue ; } ) ;
return input ;
}
}
}
#endif