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(); } } }