chrisgregan
10 years ago
2 changed files with 61 additions and 0 deletions
@ -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(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,12 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 2a336080b178f4c239754dd614d6d6b4 |
||||||
|
timeCreated: 1440156410 |
||||||
|
licenseType: Free |
||||||
|
MonoImporter: |
||||||
|
serializedVersion: 2 |
||||||
|
defaultReferences: [] |
||||||
|
executionOrder: 0 |
||||||
|
icon: {instanceID: 0} |
||||||
|
userData: |
||||||
|
assetBundleName: |
||||||
|
assetBundleVariant: |
Loading…
Reference in new issue