示例#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
    void HandleShowResult(ShowResult result)
    {
        switch (result)
        {
        case ShowResult.Finished:
            Debug.Log("Video completed - Offer a reward to the player");
            saveLoadData.SaveScore(0, 20);

            if (coolDown > 0f)
            {
                remainingCoolDown = coolDown;
                PlayerPrefs.SetString("LastPresentTime", Convert.ToString(currentTime));
            }
            break;

        case ShowResult.Skipped:
            Debug.LogWarning("Video was skipped - Do NOT reward the player");
            break;

        case ShowResult.Failed:
            Debug.LogError("Video failed to show");
            break;
        }
    }
示例#3
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));
    }
示例#4
0
 public void AddGems()
 {
     saveLoadData.SaveScore(-1, 230);
     print("got gems");
 }