Exemplo n.º 1
0
    /// <summary>
    ///
    /// </summary>
    public void SaveClass(Action callBack = null)
    {
#if ULSP
        if (bl_DataBase.Instance != null)
        {
            string dbdata = $"{AssaultClass.ToString()},{EngineerClass.ToString()},{ReconClass.ToString()},{SupportClass.ToString()}";
            bl_DataBase.Instance.LocalUser.metaData.rawData.WeaponsLoadouts = dbdata;
            bl_DataBase.Instance.LocalUser.metaData.rawData.ClassKit        = ClassKit;
            bl_DataBase.Instance.SaveUserMetaData(() => { callBack?.Invoke(); });
        }
        else
        {
            callBack?.Invoke();
        }
#else
        callBack?.Invoke();
#endif
        string key  = string.Format(LOADOUT_KEY_FORMAT, PlayerClass.Assault);
        string data = AssaultClass.ToString();
        PlayerPrefs.SetString(key, data);

        key  = string.Format(LOADOUT_KEY_FORMAT, PlayerClass.Engineer);
        data = EngineerClass.ToString();
        PlayerPrefs.SetString(key, data);

        key  = string.Format(LOADOUT_KEY_FORMAT, PlayerClass.Recon);
        data = ReconClass.ToString();
        PlayerPrefs.SetString(key, data);

        key  = string.Format(LOADOUT_KEY_FORMAT, PlayerClass.Support);
        data = SupportClass.ToString();
        PlayerPrefs.SetString(key, data);

        PlayerPrefs.SetInt(ClassKey.ClassKit, ClassKit);
    }