diff --git a/Assets/Fungus/Narrative/Editor/DialogInputEditor.cs b/Assets/Fungus/Narrative/Editor/DialogInputEditor.cs new file mode 100644 index 00000000..61d552e8 --- /dev/null +++ b/Assets/Fungus/Narrative/Editor/DialogInputEditor.cs @@ -0,0 +1,49 @@ +using UnityEditor; +using UnityEngine; +using System.Collections; +using Rotorz.ReorderableList; +using System.Collections.Generic; + +namespace Fungus +{ + + [CustomEditor (typeof(DialogInput))] + public class DialogInputEditor : Editor + { + protected SerializedProperty clickModeProp; + protected SerializedProperty nextClickDelayProp; + protected SerializedProperty keyPressModeProp; + protected SerializedProperty shiftKeyEnabledProp; + protected SerializedProperty keyListProp; + + protected virtual void OnEnable() + { + clickModeProp = serializedObject.FindProperty ("clickMode"); + nextClickDelayProp = serializedObject.FindProperty ("nextClickDelay"); + keyPressModeProp = serializedObject.FindProperty ("keyPressMode"); + shiftKeyEnabledProp = serializedObject.FindProperty ("shiftKeyEnabled"); + keyListProp = serializedObject.FindProperty ("keyList"); + } + + public override void OnInspectorGUI() + { + serializedObject.Update(); + + DialogInput t = target as DialogInput; + + EditorGUILayout.PropertyField(clickModeProp); + EditorGUILayout.PropertyField(nextClickDelayProp); + + EditorGUILayout.PropertyField(keyPressModeProp); + if (t.keyPressMode == DialogInput.KeyPressMode.KeyPressed) + { + EditorGUILayout.PropertyField(shiftKeyEnabledProp); + ReorderableListGUI.Title(new GUIContent("Key List", "Keycodes to check for user input")); + ReorderableListGUI.ListField(keyListProp); + } + + serializedObject.ApplyModifiedProperties(); + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Narrative/Editor/DialogInputEditor.cs.meta b/Assets/Fungus/Narrative/Editor/DialogInputEditor.cs.meta new file mode 100644 index 00000000..3419bb5f --- /dev/null +++ b/Assets/Fungus/Narrative/Editor/DialogInputEditor.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 2a336080b178f4c239754dd614d6d6b4 +timeCreated: 1440156410 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: