diff --git a/Assets/Fungus/FungusScript/Editor/JumpEditor.cs b/Assets/Fungus/FungusScript/Editor/JumpEditor.cs new file mode 100644 index 00000000..a654db8c --- /dev/null +++ b/Assets/Fungus/FungusScript/Editor/JumpEditor.cs @@ -0,0 +1,32 @@ +using UnityEditor; +using UnityEngine; +using System.Collections; +using System.Collections.Generic; + +namespace Fungus +{ + [CustomEditor (typeof(Jump))] + public class JumpEditor : CommandEditor + { + protected SerializedProperty targetLabelProp; + + protected virtual void OnEnable() + { + targetLabelProp = serializedObject.FindProperty("targetLabel"); + } + + public override void DrawCommandGUI() + { + serializedObject.Update(); + + Jump t = target as Jump; + + LabelEditor.LabelField(targetLabelProp, + new GUIContent("Target Label", "Label to jump to"), + t.parentSequence); + + serializedObject.ApplyModifiedProperties(); + } + } + +} diff --git a/Assets/Fungus/FungusScript/Editor/JumpEditor.cs.meta b/Assets/Fungus/FungusScript/Editor/JumpEditor.cs.meta new file mode 100644 index 00000000..1f64861f --- /dev/null +++ b/Assets/Fungus/FungusScript/Editor/JumpEditor.cs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c1fd0ccd416054df994af1949fa6fce3 +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: diff --git a/Assets/Fungus/FungusScript/Editor/LabelEditor.cs b/Assets/Fungus/FungusScript/Editor/LabelEditor.cs new file mode 100644 index 00000000..a3dcd480 --- /dev/null +++ b/Assets/Fungus/FungusScript/Editor/LabelEditor.cs @@ -0,0 +1,53 @@ +using UnityEditor; +using UnityEditorInternal; +using UnityEngine; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Fungus +{ + public class LabelEditor + { + + static public void LabelField(SerializedProperty property, + GUIContent labelText, + Sequence sequence) + { + List labelKeys = new List(); + List