Ejemplo n.º 1
0
    private void ApplyState(GoSettingsSave i_Save)
    {
        LogManager.Log(this, LogContexts.Saves, "Start load save.");

        ClearAll();

        if (i_Save == null)
        {
            return;
        }

        for (int index = 0; index < i_Save.settingsCount; ++index)
        {
            GoSetting setting = i_Save.GetSetting(index);

            if (setting == null)
            {
                continue;
            }

            int id = setting.id;

            switch (setting.type)
            {
            case SettingType.Bool:
                SetBool(id, setting.boolValue);
                LogManager.Log(this, LogContexts.Saves, "Loaded: (bool)" + id + " --> " + setting.boolValue);
                break;

            case SettingType.Float:
                SetFloat(id, setting.floatValue);
                LogManager.Log(this, LogContexts.Saves, "Loaded: (float)" + id + " --> " + setting.floatValue);
                break;

            case SettingType.Int:
                SetInt(id, setting.intValue);
                LogManager.Log(this, LogContexts.Saves, "Loaded: (int)" + id + " --> " + setting.intValue);
                break;

            case SettingType.String:
                SetString(id, setting.stringValue);
                LogManager.Log(this, LogContexts.Saves, "Loaded: (string)" + id + " --> " + setting.stringValue);
                break;
            }
        }

        LogManager.Log(this, LogContexts.Saves, "Save loaded.");
    }
Ejemplo n.º 2
0
    public void AddBool(int i_Id, bool i_Value)
    {
        GoSetting setting = new GoSetting(i_Id, i_Value);

        m_Settings.Add(setting);
    }
Ejemplo n.º 3
0
    public void AddString(int i_Id, string i_Value)
    {
        GoSetting setting = new GoSetting(i_Id, i_Value);

        m_Settings.Add(setting);
    }
Ejemplo n.º 4
0
    public void AddFloat(int i_Id, float i_Value)
    {
        GoSetting setting = new GoSetting(i_Id, i_Value);

        m_Settings.Add(setting);
    }