Пример #1
0
    void Buy()
    {
        print("Buying process");

        int price = System.Int32.Parse(this.transform.Find("Skin Price").
                                       GetComponent <UnityEngine.UI.Text>().text);
        int playerGems = saveLoadData.LoadCount(true);

        if (playerGems >= price)
        {
            saveLoadData.SaveSkinData(skinName, skinNumber, true);
            isAvailable = saveLoadData.LoadSkinData(skinName, skinNumber);
            saveLoadData.SaveScore(-1, -price);
            this.transform.Find("Skin Price").
            GetComponent <UnityEngine.UI.Text>().text = "Use";
        }
        else
        {
            print("not enough money");
        }
    }
Пример #2
0
    public void GameOver()
    {
        StopCoroutine(spawnWaves);
        StopCoroutine(spawnPickUps);
        gamesPlayed++;
        if (gamesPlayed % 3 == 0)
        {
            linkManager.ShowUsualAd();
        }
        inGamePanel.SetActive(false);
        losePanel.SetActive(true);
        finalScoreText.text = score.ToString();
        //print("Game Over");
        gameOver = true;

        //print(saveLoadData.LoadCount(true));
        //print(gems);
        saveLoadData.SaveScore(score, gems);
        if (scoreIsMore)
        {
            newRecordMessage.SetActive(true);
        }
        print(saveLoadData.LoadCount(false));
    }
Пример #3
0
 public void UpdateGems()
 {
     GetComponent <Text>().text = saveLoadData.LoadCount(true).ToString();
 }