Example #1
0
    void Awake()
    {
        DontDestroyOnLoad(this.gameObject);
        currentGame = GameId.NONE;

        string data = VKFileHelper.LoadTextFromFile(_fileLocalName);

        if (string.IsNullOrEmpty(data))
        {
            localData = new LocalData();
        }
        else
        {
            localData = JsonUtility.FromJson <LocalData>(data);
        }

        var    configAsset = Resources.Load("Data/GameConfig") as TextAsset;
        string config      = configAsset.text;

        if (string.IsNullOrEmpty(config))
        {
            serverConfig = new ServerConfig();
        }
        else
        {
            serverConfig = JsonUtility.FromJson <ServerConfig>(config);
        }

        // config
        if (string.IsNullOrEmpty(data))
        {
#if UNITY_ANDROID
            if (SystemInfo.systemMemorySize > 1200)
            {
                SettingHighQuantity(true);
            }
            else
            {
                SettingHighQuantity(false);
            }
#elif UNITY_IOS
            UnityEngine.iOS.Device.hideHomeButton = true;

            if (SystemInfo.systemMemorySize > 600)
            {
                SettingHighQuantity(true);
            }
            else
            {
                SettingHighQuantity(false);
            }
#else
            SettingHighQuantity(true);
#endif
        }
        else
        {
            SettingHighQuantity(localData.isHighQuantity);
        }
    }
Example #2
0
    public void SaveLocalData()
    {
        string data = JsonUtility.ToJson(localData);

        VKFileHelper.WriteTextToFile(_fileLocalName, data);
    }