Example #1
0
    public void SellSkin()
    {
        if (cost <= PersistentData.DNA.Get() && !isBought)
        {
            PersistentData.DNA.Remove(cost);

            //isBought = true;
            //costGameObject.SetActive(false);
            PersistentData.VirusSkin.Unlock(skinNumber);

            shopPanel.preview.ShowSkinOnPreviewTable(this);
            UnlockSkin();
            //skinMaxLevelInt = 0;
            //skinMaxLevel.SetActive(true);

            //lockIcon.enabled = false;

            FacebookSDK.SkinPurchaseEventLog(skinNumber, cost); // FACEBOOK
        }

        else if (!isBought /*&& !isSecretSkin*/)
        {
            shopPanel.SignOnPurse();
        }
    }
Example #2
0
    public void OnDNAPurchasingComplete(int value)
    {
        int currentPlayerDna = PersistentData.DNA.Get();

        cyText.text = currentPlayerDna.ToString();

        StartCoroutine(AddDnaEffect(currentPlayerDna + value, currentPlayerDna));

        PersistentData.DNA.Add(value);

        UIShopPanel.Singletone.RefreshDnaText();

        FacebookSDK.DnaPurchaseEventLog(value);
    }
Example #3
0
    public void SetPlayerName()
    {
        string nickname = GetComponent <Text>().text;

        PersistentData.Nickname.Set(nickname);
        PersistentData.Save();

        menuAnimator.ShowMenu();

        menuNicknamePanel.SetActive(true);
        menuNicknamePanel.GetComponentInChildren <InputField>().text = nickname;
        thisInputField.SetActive(false);

        FacebookSDK.FirstOpenEventLog(); // FACEBOOK
    }
Example #4
0
    private void Awake()
    {
        SetPlayerStats();
        SetScoreOnPanel();

        particles.Stop();

        if (_isNewHighScore)
        {
            highScoreText.SetActive(true);
            scoreText.SetActive(false);
        }

        levelNameText.text = "LVL: 0";
        barScore.text      = "0";

        int newLevel   = 0;
        int scoreToLvl = _playerScore;
        int newDna     = 0;

        TemporaryData.SavedKills = _playerKills;
        TemporaryData.SavedScore = _playerScore;

        Analytics.LogPlayerScore(_playerScore);

        if (_playerScore < TargetsToUpLevel[TargetsToUpLevel.Length - 1])
        {
            while (scoreToLvl - TargetsToUpLevel[newLevel + 1] >= 0)
            {
                newDna = TargetsToUpLevel[++newLevel];
            }
        }

        else
        {
            newDna   = _playerScore;
            newLevel = 20;
            PersistentData.VirusSkin.SecretSkin.Unlock();
        }

        _newSkinLevelPref = newLevel;
        _newDnaPref       = newDna;

        FacebookSDK.NewLevelEventLog(newLevel); // FACEBOOK

        StartCoroutine(FillProgressBar());
    }