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.
46 lines
923 B
46 lines
923 B
10 years ago
|
using UnityEngine;
|
||
10 years ago
|
using System.Collections;
|
||
|
|
||
|
namespace Fungus.Script
|
||
|
{
|
||
|
|
||
|
public class StringVariable : FungusVariable
|
||
|
{
|
||
|
string stringValue;
|
||
|
|
||
|
public string Value
|
||
|
{
|
||
10 years ago
|
get { return (scope == VariableScope.Local) ? stringValue : GlobalVariables.GetString(key); }
|
||
|
set { if (scope == VariableScope.Local) { stringValue = value; } else { GlobalVariables.SetString(key, value); } }
|
||
10 years ago
|
}
|
||
|
}
|
||
|
|
||
10 years ago
|
[System.Serializable]
|
||
|
public class StringData
|
||
|
{
|
||
10 years ago
|
[SerializeField]
|
||
|
StringVariable stringReference;
|
||
|
|
||
|
[SerializeField]
|
||
|
string stringValue;
|
||
10 years ago
|
|
||
|
public string Value
|
||
|
{
|
||
|
get { return (stringReference == null) ? stringValue : stringReference.Value; }
|
||
|
set { if (stringReference == null) { stringValue = value; } else { stringReference.Value = value; } }
|
||
|
}
|
||
10 years ago
|
|
||
|
public string GetDescription()
|
||
|
{
|
||
|
if (stringReference == null)
|
||
|
{
|
||
|
return stringValue;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
return stringReference.key;
|
||
|
}
|
||
|
}
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
}
|