Browse Source

Reverted variables back to MonoBehavior

master
chrisgregan 11 years ago
parent
commit
c6c82dbb44
  1. BIN
      Assets/Example/Scenes/Example.unity
  2. 2
      Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs
  3. 2
      Assets/Fungus/FungusScript/Editor/IfEditor.cs
  4. 2
      Assets/Fungus/FungusScript/Scripts/Variable.cs

BIN
Assets/Example/Scenes/Example.unity

Binary file not shown.

2
Assets/Fungus/FungusScript/Editor/FungusScriptEditor.cs

@ -127,7 +127,7 @@ namespace Fungus
}
Undo.RecordObject(fungusScript, "Add Variable");
T newVariable = ScriptableObject.CreateInstance<T>();
T newVariable = fungusScript.gameObject.AddComponent<T>();
newVariable.key = fungusScript.GetUniqueVariableKey("");
fungusScript.variables.Add(newVariable);
}

2
Assets/Fungus/FungusScript/Editor/IfEditor.cs

@ -50,7 +50,7 @@ namespace Fungus
return;
}
Variable selectedVariable = (Variable)variableProp.objectReferenceValue;
Variable selectedVariable = variableProp.objectReferenceValue as Variable;
System.Type variableType = selectedVariable.GetType();
List<GUIContent> operatorList = new List<GUIContent>();

2
Assets/Fungus/FungusScript/Scripts/Variable.cs

@ -18,7 +18,7 @@ namespace Fungus
Global
}
public class Variable : ScriptableObject
public class Variable : MonoBehaviour
{
public VariableScope scope;
public string key = "";

Loading…
Cancel
Save