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