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.
44 lines
1.3 KiB
44 lines
1.3 KiB
using UnityEditor; |
|
using UnityEditorInternal; |
|
using UnityEngine; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using Rotorz.ReorderableList; |
|
|
|
namespace Fungus |
|
{ |
|
|
|
[CustomEditor (typeof(AddOption))] |
|
public class AddOptionEditor : CommandEditor |
|
{ |
|
SerializedProperty optionTextProp; |
|
SerializedProperty hideOnSelectedProp; |
|
SerializedProperty targetSequenceProp; |
|
|
|
void OnEnable() |
|
{ |
|
optionTextProp = serializedObject.FindProperty("optionText"); |
|
hideOnSelectedProp = serializedObject.FindProperty("hideOnSelected"); |
|
targetSequenceProp = serializedObject.FindProperty("targetSequence"); |
|
} |
|
|
|
public override void DrawCommandGUI() |
|
{ |
|
serializedObject.Update(); |
|
|
|
AddOption t = target as AddOption; |
|
|
|
EditorGUILayout.PropertyField(optionTextProp, new GUIContent("Option Text", "Text to display on the option button.")); |
|
|
|
SequenceEditor.SequenceField(targetSequenceProp, |
|
new GUIContent("Target Sequence", "Sequence to execute when this option is selected by the player."), |
|
new GUIContent("<Continue>"), |
|
t.GetFungusScript()); |
|
|
|
EditorGUILayout.PropertyField(hideOnSelectedProp, new GUIContent("Hide On Selected", "Hide this option forever once the player has selected it.")); |
|
|
|
serializedObject.ApplyModifiedProperties(); |
|
} |
|
} |
|
|
|
} |