chrisgregan
11 years ago
4 changed files with 31 additions and 48 deletions
@ -1,47 +0,0 @@ |
|||||||
using UnityEditor; |
|
||||||
using UnityEditorInternal; |
|
||||||
using UnityEngine; |
|
||||||
using System.Collections; |
|
||||||
using System.Collections.Generic; |
|
||||||
|
|
||||||
namespace Fungus.Script |
|
||||||
{ |
|
||||||
|
|
||||||
[CustomEditor (typeof(AddOption))] |
|
||||||
public class AddOptionEditor : FungusCommandEditor |
|
||||||
{ |
|
||||||
public override void DrawCommandInspectorGUI() |
|
||||||
{ |
|
||||||
AddOption t = target as AddOption; |
|
||||||
|
|
||||||
EditorGUI.BeginChangeCheck(); |
|
||||||
|
|
||||||
string newText = EditorGUILayout.TextField(new GUIContent("Text", "Text to display on option button"), t.text); |
|
||||||
Sequence newSequence = SequenceEditor.SequenceField(new GUIContent("Sequence", "Sequence to execute when this option is selected"), |
|
||||||
t.GetFungusScript(), |
|
||||||
t.sequence); |
|
||||||
AddOption.Condition newCondition = (AddOption.Condition)EditorGUILayout.EnumPopup(new GUIContent("Condition", "Conditions for when this option is displayed"), t.condition); |
|
||||||
|
|
||||||
if (EditorGUI.EndChangeCheck()) |
|
||||||
{ |
|
||||||
Undo.RecordObject(t, "Set AddOption command"); |
|
||||||
|
|
||||||
t.text = newText; |
|
||||||
t.sequence = newSequence; |
|
||||||
t.condition = newCondition; |
|
||||||
} |
|
||||||
|
|
||||||
if (t.condition == AddOption.Condition.ShowOnBoolean || |
|
||||||
t.condition == AddOption.Condition.HideOnBoolean) |
|
||||||
{ |
|
||||||
string newBooleanVariableKey = EditorGUILayout.TextField(new GUIContent("Boolean Variable Key", "Boolean variable to check for condition"), t.booleanVariableKey); |
|
||||||
if (newBooleanVariableKey != t.booleanVariableKey) |
|
||||||
{ |
|
||||||
Undo.RecordObject(t, "Set Boolean Variable"); |
|
||||||
t.booleanVariableKey = newBooleanVariableKey; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -0,0 +1,30 @@ |
|||||||
|
using UnityEditor; |
||||||
|
using UnityEditorInternal; |
||||||
|
using UnityEngine; |
||||||
|
using System.Collections; |
||||||
|
using System.Collections.Generic; |
||||||
|
|
||||||
|
namespace Fungus.Script |
||||||
|
{ |
||||||
|
|
||||||
|
[CustomEditor (typeof(Jump))] |
||||||
|
public class JumpEditor : FungusCommandEditor |
||||||
|
{ |
||||||
|
public override void DrawCommandInspectorGUI() |
||||||
|
{ |
||||||
|
Jump t = target as Jump; |
||||||
|
|
||||||
|
EditorGUI.BeginChangeCheck(); |
||||||
|
|
||||||
|
Sequence newSequence = SequenceEditor.SequenceField(new GUIContent("Sequence", "Sequence to jump to"), |
||||||
|
t.GetFungusScript(), |
||||||
|
t.targetSequence); |
||||||
|
if (EditorGUI.EndChangeCheck()) |
||||||
|
{ |
||||||
|
Undo.RecordObject(t, "Set Jump command"); |
||||||
|
t.targetSequence = newSequence; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,5 +1,5 @@ |
|||||||
fileFormatVersion: 2 |
fileFormatVersion: 2 |
||||||
guid: a20371077211a4cc394cb2192fdc4417 |
guid: 970dc31f991bd4b0ba8e3475419f3272 |
||||||
MonoImporter: |
MonoImporter: |
||||||
serializedVersion: 2 |
serializedVersion: 2 |
||||||
defaultReferences: [] |
defaultReferences: [] |
Binary file not shown.
Loading…
Reference in new issue