Esempio n. 1
0
        public void OnClickButton()
        {
            if (selectItem.canSelect)
            {
                SoundController.Instance.PlaySe(SoundController.Instance.buttonSe);
                EncryptedPlayerPrefs.SaveInt(Const.KEY_CHARA, int.Parse(selectItem.num));
                Retry();
                return;
            }

            if (selectItem.canBuy)
            {
                SoundController.Instance.PlaySe(SoundController.Instance.casher);

                int point = EncryptedPlayerPrefs.LoadInt(Const.KEY_POINT, 0);
                int diff  = point - selectItem.price;
                EncryptedPlayerPrefs.SaveInt(Const.KEY_POINT, diff);
                pointText.text = diff + "P";
                string enabledCharas = EncryptedPlayerPrefs.LoadString(Const.KEY_ENABLE_CHARAS, "0");
                enabledCharas = enabledCharas + "," + selectItem.num;
                EncryptedPlayerPrefs.SaveString(Const.KEY_ENABLE_CHARAS, enabledCharas);
                selectItem.canSelect = true;
                priceText.text       = ("PLAY");
            }
        }
Esempio n. 2
0
    private void AddEnableCharas(int charaNo)
    {
        string enabeledCharas = EncryptedPlayerPrefs.LoadString(Const.KEY_ENABLE_CHARAS, Const.ENABLE_CHARAS_DEFAULT);

        enabeledCharas = enabeledCharas + "," + charaNo.ToString();
        EncryptedPlayerPrefs.SaveString(Const.KEY_ENABLE_CHARAS, enabeledCharas);
    }
Esempio n. 3
0
 public void Save(string name)
 => EncryptedPlayerPrefs.SaveString(NameKey, name);