Beispiel #1
0
 public void UpgradeFirePower()
 {
     if (prefsControl.GetCurrentGameMoney() >= FIRE_POWER)
     {
         prefsControl.SetFirePower(prefsControl.GetFirePower() + 1);
         prefsControl.SetCurrentGameMoney(prefsControl.GetCurrentGameMoney() - FIRE_POWER);
         CalculateLevel();
     }
     else
     {
         error.gameObject.SetActive(true);
     }
 }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     playerPrefs   = FindObjectOfType <PlayerPrefsControlScript>();
     gameScore     = playerPrefs.GetGameMoney();
     currentScore  = playerPrefs.GetCurrentGameMoney();
     currentScore += gameScore;
     earned        = GameObject.Find("Txt_GameScore").GetComponent <Text>();
     total         = GameObject.Find("Txt_CurrentGameScore").GetComponent <Text>();
     earned.text   = gameScore.ToString();
     total.text    = currentScore.ToString();
     playerPrefs.SetAccumalitiveMoney(playerPrefs.GetAccumalitiveMoney() + gameScore);
     gameScore = 0;
     playerPrefs.SetGameMoney(gameScore);
     playerPrefs.SetCurrentGameMoney(currentScore);
     evSystem = FindObjectOfType <EventSystem>();
 }