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.
42 lines
1.0 KiB
42 lines
1.0 KiB
10 years ago
|
using UnityEditor;
|
||
|
using UnityEngine;
|
||
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
|
namespace Fungus
|
||
|
{
|
||
|
[CustomEditor (typeof(MenuTimer))]
|
||
|
public class MenuTimerEditor : CommandEditor
|
||
|
{
|
||
|
protected SerializedProperty durationProp;
|
||
|
protected SerializedProperty targetSequenceProp;
|
||
|
|
||
|
protected virtual void OnEnable()
|
||
|
{
|
||
|
durationProp = serializedObject.FindProperty("duration");
|
||
|
targetSequenceProp = serializedObject.FindProperty("targetSequence");
|
||
|
}
|
||
|
|
||
|
public override void DrawCommandGUI()
|
||
|
{
|
||
|
FungusScript fungusScript = FungusScriptWindow.GetFungusScript();
|
||
|
if (fungusScript == null)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
serializedObject.Update();
|
||
|
|
||
|
EditorGUILayout.PropertyField(durationProp);
|
||
|
|
||
|
SequenceEditor.SequenceField(targetSequenceProp,
|
||
|
new GUIContent("Target Sequence", "Sequence to call when timer expires"),
|
||
|
new GUIContent("<None>"),
|
||
|
fungusScript);
|
||
|
|
||
|
serializedObject.ApplyModifiedProperties();
|
||
|
}
|
||
|
}
|
||
|
}
|