Browse Source

Global variables are stored using Variables class

master
chrisgregan 11 years ago
parent
commit
84f22e7a5d
  1. 16
      Assets/Fungus/VisualScripting/Variable.cs

16
Assets/Fungus/VisualScripting/Variable.cs

@ -33,26 +33,26 @@ namespace Fungus.Script
public bool BooleanValue public bool BooleanValue
{ {
get { return booleanValue; } get { return (scope == VariableScope.Local) ? booleanValue : Variables.GetBoolean(key); }
set { booleanValue = value; } set { if (scope == VariableScope.Local) { booleanValue = value; } else { Variables.SetBoolean(key, value); } }
} }
public int IntegerValue public int IntegerValue
{ {
get { return integerValue; } get { return (scope == VariableScope.Local) ? integerValue : Variables.GetInteger(key); }
set { integerValue = value; } set { if (scope == VariableScope.Local) { integerValue = value; } else { Variables.SetInteger(key, value); } }
} }
public float FloatValue public float FloatValue
{ {
get { return floatValue; } get { return (scope == VariableScope.Local) ? floatValue : Variables.GetFloat(key); }
set { floatValue = value; } set { if (scope == VariableScope.Local) { floatValue = value; } else { Variables.SetFloat(key, value); } }
} }
public string StringValue public string StringValue
{ {
get { return stringValue; } get { return (scope == VariableScope.Local) ? stringValue : Variables.GetString(key); }
set { stringValue = value; } set { if (scope == VariableScope.Local) { stringValue = value; } else { Variables.SetString(key, value); } }
} }
public bool IsSameType(Variable other) public bool IsSameType(Variable other)

Loading…
Cancel
Save