You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB

using UnityEditor;
using UnityEngine;
namespace uc
{
[CanEditMultipleObjects, CustomEditor(typeof(TimerActivity), false)]
public class TimerActivityEditor : ActivityEditor
{
SerializedProperty m_TimerDurationProperty;
GUIContent m_TimerDurationLabel;
SerializedProperty m_OnTimesupProperty;
GUIContent m_OnTimesupLabel;
protected override void OnEnable()
{
base.OnEnable();
m_TimerDurationProperty = serializedObject.FindProperty("timerDuration");
m_TimerDurationLabel = new GUIContent("Timer Duration", "timer duration");
m_OnTimesupProperty = serializedObject.FindProperty("onTimesUp");
m_OnTimesupLabel = new GUIContent("On Timesup", "on timesup event");
}
public override void OnInspectorGUI()
{
EditorGUILayout.Space();
serializedObject.Update();
EditorGUILayout.PropertyField(m_TimerDurationProperty, m_TimerDurationLabel);
EditorGUILayout.PropertyField(m_OnTimesupProperty, m_OnTimesupLabel);
DrawActivityInspectorGUI();
DrawEventInspectorGUI();
serializedObject.ApplyModifiedProperties();
}
}
}