private Variable CreateVariable(int maxCount, int referenceCount) { var variable = ScriptableObject.CreateInstance <Variable>(); variable.Name = JavaClassNameGenerator.GenerateClassName(maxCount); variable.ReferenceCount = referenceCount; variablesManager.AddVariable(variable); return(variable); }
/// <summary> /// Read "Content/variables.txt" json file and create GameVariable objects and sliders for each of them /// </summary> void ImportVariables() { JsonData gameVariables = JsonMapper.ToObject(variablesText.text); for (int i = 0; i < gameVariables["variables"].Count; i++) { // create a new GameVariable and slider varManager.AddVariable(gameVariables["variables"][i].ToJson(), i, gameVariables["variables"].Count); } }
public void SetVar(string val) { string key = dropdown.options[dropdown.value].text; manager.AddVariable(key, int.Parse(val)); }