From 64cf2c346e50f52ef956ecded9c819678dd25337 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Wed, 10 Sep 2014 17:39:41 +0100 Subject: [PATCH] Renamed FungusVariable to Variable --- Assets/Example/Scenes/Example.unity | Bin 128404 -> 128372 bytes Assets/Fungus/FungusScript/Commands/If.cs | 4 +- .../FungusScript/Commands/SetVariable.cs | 4 +- .../FungusScript/Editor/FungusScriptEditor.cs | 4 +- Assets/Fungus/FungusScript/Editor/IfEditor.cs | 4 +- .../FungusScript/Editor/SetVariableEditor.cs | 4 +- ...gusVariableEditor.cs => VariableEditor.cs} | 40 +++++++++--------- ...eEditor.cs.meta => VariableEditor.cs.meta} | 0 ...eListAdaptor.cs => VariableListAdaptor.cs} | 12 +++--- ...or.cs.meta => VariableListAdaptor.cs.meta} | 0 .../FungusScript/Scripts/BooleanVariable.cs | 2 +- Assets/Fungus/FungusScript/Scripts/Command.cs | 2 +- .../FungusScript/Scripts/FloatVariable.cs | 2 +- .../FungusScript/Scripts/FungusScript.cs | 6 +-- .../FungusScript/Scripts/IntegerVariable.cs | 2 +- .../FungusScript/Scripts/StringVariable.cs | 2 +- .../{FungusVariable.cs => Variable.cs} | 2 +- ...ungusVariable.cs.meta => Variable.cs.meta} | 0 18 files changed, 45 insertions(+), 45 deletions(-) rename Assets/Fungus/FungusScript/Editor/{FungusVariableEditor.cs => VariableEditor.cs} (87%) rename Assets/Fungus/FungusScript/Editor/{FungusVariableEditor.cs.meta => VariableEditor.cs.meta} (100%) rename Assets/Fungus/FungusScript/Editor/{FungusVariableListAdaptor.cs => VariableListAdaptor.cs} (92%) rename Assets/Fungus/FungusScript/Editor/{FungusVariableListAdaptor.cs.meta => VariableListAdaptor.cs.meta} (100%) rename Assets/Fungus/FungusScript/Scripts/{FungusVariable.cs => Variable.cs} (86%) rename Assets/Fungus/FungusScript/Scripts/{FungusVariable.cs.meta => Variable.cs.meta} (100%) diff --git a/Assets/Example/Scenes/Example.unity b/Assets/Example/Scenes/Example.unity index e29d0f584258c9ebd904e2c07ef5f16ca942640e..5c0a698c5c0b4e8248171571824d608afa1821d3 100644 GIT binary patch delta 102 zcmbR8n*GZwb^!*)3?Bx@uO$o&44goA!bX98+?%g(&lcTWs_4VW5tdk#nV6K5I(cJb z=4K0JRqM%DxGOi`iOUPz9I(M*$M#7Xj2E&P=WI{D%qT0$Q+MD-Ezlr_CLq1N=LI7N FF93G%QVcUF;d$uT;k*VmzIJs^Q+vcrG z)2u-vlh1KiZaxy17YGvNbh6~%b7i2JA%3_?i-T5-3 XtSBp2h^GR>bf7`P+bdo${^0=tqNp#U diff --git a/Assets/Fungus/FungusScript/Commands/If.cs b/Assets/Fungus/FungusScript/Commands/If.cs index 872b5955..d3d5d2a5 100644 --- a/Assets/Fungus/FungusScript/Commands/If.cs +++ b/Assets/Fungus/FungusScript/Commands/If.cs @@ -19,7 +19,7 @@ namespace Fungus.Script "If the test expression is true, execute the following block of commands.")] public class If : Command { - public FungusVariable variable; + public Variable variable; public CompareOperator compareOperator; @@ -212,7 +212,7 @@ namespace Fungus.Script return summary; } - public override bool HasReference(FungusVariable variable) + public override bool HasReference(Variable variable) { return (variable == this.variable); } diff --git a/Assets/Fungus/FungusScript/Commands/SetVariable.cs b/Assets/Fungus/FungusScript/Commands/SetVariable.cs index 164e6588..bef66593 100644 --- a/Assets/Fungus/FungusScript/Commands/SetVariable.cs +++ b/Assets/Fungus/FungusScript/Commands/SetVariable.cs @@ -18,7 +18,7 @@ namespace Fungus.Script Divide // /= } - public FungusVariable variable; + public Variable variable; public SetOperator setOperator; @@ -173,7 +173,7 @@ namespace Fungus.Script return description; } - public override bool HasReference(FungusVariable variable) + public override bool HasReference(Variable variable) { return (variable == this.variable); } diff --git a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs index df2c833c..9c7491d3 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs @@ -98,7 +98,7 @@ namespace Fungus.Script ReorderableListGUI.Title("Variables"); - FungusVariableListAdaptor adaptor = new FungusVariableListAdaptor(variablesProp, 0); + VariableListAdaptor adaptor = new VariableListAdaptor(variablesProp, 0); ReorderableListControl.DrawControlFromState(adaptor, null, ReorderableListFlags.DisableContextMenu | ReorderableListFlags.HideAddButton); GUILayout.BeginHorizontal(); @@ -118,7 +118,7 @@ namespace Fungus.Script GUILayout.EndHorizontal(); } - void AddVariable(object obj) where T : FungusVariable + void AddVariable(object obj) where T : Variable { FungusScript fungusScript = obj as FungusScript; if (fungusScript == null) diff --git a/Assets/Fungus/FungusScript/Editor/IfEditor.cs b/Assets/Fungus/FungusScript/Editor/IfEditor.cs index 9aff267c..e8003fd3 100644 --- a/Assets/Fungus/FungusScript/Editor/IfEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/IfEditor.cs @@ -38,7 +38,7 @@ namespace Fungus.Script return; } - FungusVariableEditor.VariableField(variableProp, + VariableEditor.VariableField(variableProp, new GUIContent("Variable", "Variable to use in operation"), t.GetFungusScript(), null); @@ -49,7 +49,7 @@ namespace Fungus.Script return; } - FungusVariable selectedVariable = variableProp.objectReferenceValue as FungusVariable; + Variable selectedVariable = variableProp.objectReferenceValue as Variable; System.Type variableType = selectedVariable.GetType(); List operatorList = new List(); diff --git a/Assets/Fungus/FungusScript/Editor/SetVariableEditor.cs b/Assets/Fungus/FungusScript/Editor/SetVariableEditor.cs index 93e12715..95de234b 100644 --- a/Assets/Fungus/FungusScript/Editor/SetVariableEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/SetVariableEditor.cs @@ -38,7 +38,7 @@ namespace Fungus.Script return; } - FungusVariableEditor.VariableField(variableProp, + VariableEditor.VariableField(variableProp, new GUIContent("Variable", "Variable to set"), fungusScript); @@ -49,7 +49,7 @@ namespace Fungus.Script return; } - FungusVariable selectedVariable = variableProp.objectReferenceValue as FungusVariable; + Variable selectedVariable = variableProp.objectReferenceValue as Variable; System.Type variableType = selectedVariable.GetType(); List operatorsList = new List(); diff --git a/Assets/Fungus/FungusScript/Editor/FungusVariableEditor.cs b/Assets/Fungus/FungusScript/Editor/VariableEditor.cs similarity index 87% rename from Assets/Fungus/FungusScript/Editor/FungusVariableEditor.cs rename to Assets/Fungus/FungusScript/Editor/VariableEditor.cs index 0e33252a..d15ca17d 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusVariableEditor.cs +++ b/Assets/Fungus/FungusScript/Editor/VariableEditor.cs @@ -8,30 +8,30 @@ using System.Linq; namespace Fungus.Script { - [CustomEditor (typeof(FungusVariable), true)] - public class FungusVariableEditor : CommandEditor + [CustomEditor (typeof(Variable), true)] + public class VariableEditor : CommandEditor { void OnEnable() { - FungusVariable t = target as FungusVariable; + Variable t = target as Variable; t.hideFlags = HideFlags.HideInInspector; } - static public void VariableField(SerializedProperty property, GUIContent label, FungusScript fungusScript, Func filter = null) + static public void VariableField(SerializedProperty property, GUIContent label, FungusScript fungusScript, Func filter = null) { List variableKeys = new List(); - List variableObjects = new List(); + List variableObjects = new List(); variableKeys.Add(""); variableObjects.Add(null); - List variables = fungusScript.variables; + List variables = fungusScript.variables; int index = 0; int selectedIndex = 0; - FungusVariable selectedVariable = property.objectReferenceValue as FungusVariable; + Variable selectedVariable = property.objectReferenceValue as Variable; - foreach (FungusVariable v in variables) + foreach (Variable v in variables) { if (filter != null) { @@ -97,15 +97,15 @@ namespace Fungus.Script BooleanVariable selectedBooleanVariable = referenceProp.objectReferenceValue as BooleanVariable; List variableKeys = new List(); - List variableObjects = new List(); + List variableObjects = new List(); variableKeys.Add(""); variableObjects.Add(null); - FungusVariable[] variables = fungusScript.GetComponents(); + Variable[] variables = fungusScript.GetComponents(); int index = 0; int selectedIndex = 0; - foreach (FungusVariable v in variables) + foreach (Variable v in variables) { if (v.GetType() != typeof(BooleanVariable)) { @@ -170,15 +170,15 @@ namespace Fungus.Script IntegerVariable selectedVariable = referenceProp.objectReferenceValue as IntegerVariable; List variableKeys = new List(); - List variableObjects = new List(); + List variableObjects = new List(); variableKeys.Add(""); variableObjects.Add(null); - FungusVariable[] variables = fungusScript.GetComponents(); + Variable[] variables = fungusScript.GetComponents(); int index = 0; int selectedIndex = 0; - foreach (FungusVariable v in variables) + foreach (Variable v in variables) { if (v.GetType() != typeof(IntegerVariable)) { @@ -243,15 +243,15 @@ namespace Fungus.Script FloatVariable selectedVariable = referenceProp.objectReferenceValue as FloatVariable; List variableKeys = new List(); - List variableObjects = new List(); + List variableObjects = new List(); variableKeys.Add(""); variableObjects.Add(null); - FungusVariable[] variables = fungusScript.GetComponents(); + Variable[] variables = fungusScript.GetComponents(); int index = 0; int selectedIndex = 0; - foreach (FungusVariable v in variables) + foreach (Variable v in variables) { if (v.GetType() != typeof(FloatVariable)) { @@ -316,15 +316,15 @@ namespace Fungus.Script StringVariable selectedVariable = referenceProp.objectReferenceValue as StringVariable; List variableKeys = new List(); - List variableObjects = new List(); + List variableObjects = new List(); variableKeys.Add(""); variableObjects.Add(null); - FungusVariable[] variables = fungusScript.GetComponents(); + Variable[] variables = fungusScript.GetComponents(); int index = 0; int selectedIndex = 0; - foreach (FungusVariable v in variables) + foreach (Variable v in variables) { if (v.GetType() != typeof(StringVariable)) { diff --git a/Assets/Fungus/FungusScript/Editor/FungusVariableEditor.cs.meta b/Assets/Fungus/FungusScript/Editor/VariableEditor.cs.meta similarity index 100% rename from Assets/Fungus/FungusScript/Editor/FungusVariableEditor.cs.meta rename to Assets/Fungus/FungusScript/Editor/VariableEditor.cs.meta diff --git a/Assets/Fungus/FungusScript/Editor/FungusVariableListAdaptor.cs b/Assets/Fungus/FungusScript/Editor/VariableListAdaptor.cs similarity index 92% rename from Assets/Fungus/FungusScript/Editor/FungusVariableListAdaptor.cs rename to Assets/Fungus/FungusScript/Editor/VariableListAdaptor.cs index 38975d35..965cd13c 100644 --- a/Assets/Fungus/FungusScript/Editor/FungusVariableListAdaptor.cs +++ b/Assets/Fungus/FungusScript/Editor/VariableListAdaptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012-2013 Rotorz Limited. All rights reserved. +// Copyright (c) 2012-2013 Rotorz Limited. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,7 @@ using Rotorz.ReorderableList; namespace Fungus.Script { - public class FungusVariableListAdaptor : IReorderableListAdaptor { + public class VariableListAdaptor : IReorderableListAdaptor { private SerializedProperty _arrayProperty; @@ -23,7 +23,7 @@ namespace Fungus.Script get { return _arrayProperty; } } - public FungusVariableListAdaptor(SerializedProperty arrayProperty, float fixedItemHeight) { + public VariableListAdaptor(SerializedProperty arrayProperty, float fixedItemHeight) { if (arrayProperty == null) throw new ArgumentNullException("Array property was null."); if (!arrayProperty.isArray) @@ -33,7 +33,7 @@ namespace Fungus.Script this.fixedItemHeight = fixedItemHeight; } - public FungusVariableListAdaptor(SerializedProperty arrayProperty) : this(arrayProperty, 0f) { + public VariableListAdaptor(SerializedProperty arrayProperty) : this(arrayProperty, 0f) { } public int Count { @@ -65,7 +65,7 @@ namespace Fungus.Script public void Remove(int index) { // Remove the Fungus Variable component - FungusVariable variable = _arrayProperty.GetArrayElementAtIndex(index).objectReferenceValue as FungusVariable; + Variable variable = _arrayProperty.GetArrayElementAtIndex(index).objectReferenceValue as Variable; Undo.DestroyObjectImmediate(variable); _arrayProperty.GetArrayElementAtIndex(index).objectReferenceValue = null; @@ -84,7 +84,7 @@ namespace Fungus.Script public void DrawItem(Rect position, int index) { - FungusVariable variable = this[index].objectReferenceValue as FungusVariable; + Variable variable = this[index].objectReferenceValue as Variable; float width1 = 100; float width3 = 50; diff --git a/Assets/Fungus/FungusScript/Editor/FungusVariableListAdaptor.cs.meta b/Assets/Fungus/FungusScript/Editor/VariableListAdaptor.cs.meta similarity index 100% rename from Assets/Fungus/FungusScript/Editor/FungusVariableListAdaptor.cs.meta rename to Assets/Fungus/FungusScript/Editor/VariableListAdaptor.cs.meta diff --git a/Assets/Fungus/FungusScript/Scripts/BooleanVariable.cs b/Assets/Fungus/FungusScript/Scripts/BooleanVariable.cs index da14b327..858cc9c5 100644 --- a/Assets/Fungus/FungusScript/Scripts/BooleanVariable.cs +++ b/Assets/Fungus/FungusScript/Scripts/BooleanVariable.cs @@ -5,7 +5,7 @@ using System.Collections; namespace Fungus.Script { - public class BooleanVariable : FungusVariable + public class BooleanVariable : Variable { bool booleanValue; diff --git a/Assets/Fungus/FungusScript/Scripts/Command.cs b/Assets/Fungus/FungusScript/Scripts/Command.cs index 8e857fc0..2d352d16 100644 --- a/Assets/Fungus/FungusScript/Scripts/Command.cs +++ b/Assets/Fungus/FungusScript/Scripts/Command.cs @@ -109,7 +109,7 @@ namespace Fungus.Script public virtual void GetConnectedSequences(ref List connectedSequences) {} - public virtual bool HasReference(FungusVariable variable) + public virtual bool HasReference(Variable variable) { return false; } diff --git a/Assets/Fungus/FungusScript/Scripts/FloatVariable.cs b/Assets/Fungus/FungusScript/Scripts/FloatVariable.cs index fb637577..3ec8fd72 100644 --- a/Assets/Fungus/FungusScript/Scripts/FloatVariable.cs +++ b/Assets/Fungus/FungusScript/Scripts/FloatVariable.cs @@ -4,7 +4,7 @@ using System.Collections; namespace Fungus.Script { - public class FloatVariable : FungusVariable + public class FloatVariable : Variable { float floatValue; diff --git a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs index b9f38a30..ffb29814 100644 --- a/Assets/Fungus/FungusScript/Scripts/FungusScript.cs +++ b/Assets/Fungus/FungusScript/Scripts/FungusScript.cs @@ -45,7 +45,7 @@ namespace Fungus.Script public bool colorCommands = true; - public List variables = new List(); + public List variables = new List(); void Start() { @@ -88,7 +88,7 @@ namespace Fungus.Script sequence.ExecuteNextCommand(); } - public string GetUniqueVariableKey(string originalKey, FungusVariable ignoreVariable = null) + public string GetUniqueVariableKey(string originalKey, Variable ignoreVariable = null) { int suffix = 0; string baseKey = originalKey; @@ -110,7 +110,7 @@ namespace Fungus.Script while (true) { bool collision = false; - foreach(FungusVariable variable in GetComponents()) + foreach(Variable variable in GetComponents()) { if (variable == ignoreVariable || variable.key == null) diff --git a/Assets/Fungus/FungusScript/Scripts/IntegerVariable.cs b/Assets/Fungus/FungusScript/Scripts/IntegerVariable.cs index 0ce9b4cc..ccc9c299 100644 --- a/Assets/Fungus/FungusScript/Scripts/IntegerVariable.cs +++ b/Assets/Fungus/FungusScript/Scripts/IntegerVariable.cs @@ -4,7 +4,7 @@ using System.Collections; namespace Fungus.Script { - public class IntegerVariable : FungusVariable + public class IntegerVariable : Variable { int integerValue; diff --git a/Assets/Fungus/FungusScript/Scripts/StringVariable.cs b/Assets/Fungus/FungusScript/Scripts/StringVariable.cs index ddae6fd8..7b21bab0 100644 --- a/Assets/Fungus/FungusScript/Scripts/StringVariable.cs +++ b/Assets/Fungus/FungusScript/Scripts/StringVariable.cs @@ -4,7 +4,7 @@ using System.Collections; namespace Fungus.Script { - public class StringVariable : FungusVariable + public class StringVariable : Variable { string stringValue; diff --git a/Assets/Fungus/FungusScript/Scripts/FungusVariable.cs b/Assets/Fungus/FungusScript/Scripts/Variable.cs similarity index 86% rename from Assets/Fungus/FungusScript/Scripts/FungusVariable.cs rename to Assets/Fungus/FungusScript/Scripts/Variable.cs index 65bc0d2c..6e21e438 100644 --- a/Assets/Fungus/FungusScript/Scripts/FungusVariable.cs +++ b/Assets/Fungus/FungusScript/Scripts/Variable.cs @@ -18,7 +18,7 @@ namespace Fungus.Script Global } - public class FungusVariable : MonoBehaviour + public class Variable : MonoBehaviour { public VariableScope scope; public string key = ""; diff --git a/Assets/Fungus/FungusScript/Scripts/FungusVariable.cs.meta b/Assets/Fungus/FungusScript/Scripts/Variable.cs.meta similarity index 100% rename from Assets/Fungus/FungusScript/Scripts/FungusVariable.cs.meta rename to Assets/Fungus/FungusScript/Scripts/Variable.cs.meta