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"); } }
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; } }
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)); }
public void AddGems() { saveLoadData.SaveScore(-1, 230); print("got gems"); }