예제 #1
0
    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);
    }
예제 #2
0
    /// <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);
        }
    }
예제 #3
0
    public void SetVar(string val)
    {
        string key = dropdown.options[dropdown.value].text;

        manager.AddVariable(key, int.Parse(val));
    }