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.
51 lines
1.7 KiB
51 lines
1.7 KiB
10 years ago
|
using UnityEditor;
|
||
|
using UnityEditorInternal;
|
||
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
10 years ago
|
namespace Fungus.Script
|
||
10 years ago
|
{
|
||
10 years ago
|
|
||
10 years ago
|
[CustomEditor (typeof(Say))]
|
||
10 years ago
|
public class SayEditor : FungusCommandEditor
|
||
10 years ago
|
{
|
||
10 years ago
|
public override void DrawCommandGUI()
|
||
10 years ago
|
{
|
||
10 years ago
|
Say t = target as Say;
|
||
10 years ago
|
|
||
10 years ago
|
EditorGUI.BeginChangeCheck();
|
||
|
|
||
|
string character = EditorGUILayout.TextField(new GUIContent("Character", "Character to display in dialog"), t.character);
|
||
|
|
||
10 years ago
|
EditorGUILayout.PrefixLabel(new GUIContent("Say Text", "Text to display in dialog"));
|
||
10 years ago
|
GUIStyle sayStyle = new GUIStyle(EditorStyles.textArea);
|
||
|
sayStyle.wordWrap = true;
|
||
|
string text = EditorGUILayout.TextArea(t.text, sayStyle, GUILayout.MinHeight(30));
|
||
10 years ago
|
|
||
10 years ago
|
Say.ShowCondition showCondition = (Say.ShowCondition)EditorGUILayout.EnumPopup(new GUIContent("Show Condition", "Condition when this say text should be visible."), t.showCondition);
|
||
|
|
||
10 years ago
|
BooleanVariable booleanVariable = t.booleanVariable;
|
||
10 years ago
|
|
||
|
if (showCondition == Say.ShowCondition.BooleanIsFalse ||
|
||
|
showCondition == Say.ShowCondition.BooleanIsTrue)
|
||
|
{
|
||
10 years ago
|
booleanVariable = FungusVariableEditor.VariableField (new GUIContent ("Boolean Variable", "Boolean variable to test for condition"),
|
||
|
t.GetFungusScript (),
|
||
|
t.booleanVariable,
|
||
|
v => { return v.GetType() == typeof(BooleanVariable); }) as BooleanVariable;
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
if (EditorGUI.EndChangeCheck())
|
||
10 years ago
|
{
|
||
10 years ago
|
Undo.RecordObject(t, "Set Say");
|
||
|
t.character = character;
|
||
10 years ago
|
t.text = text;
|
||
10 years ago
|
t.showCondition = showCondition;
|
||
10 years ago
|
t.booleanVariable = booleanVariable;
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
}
|
||
10 years ago
|
}
|
||
10 years ago
|
|
||
|
}
|