// Start is called before the first frame update void Start() { //Get instance associated with EaseTweenManager gameObject try { this.tween = GameObject.FindObjectOfType <EaseTweenManager>(); } catch (Exception e) { Debug.LogException(e); } this.playerHealth = this.maxHealth; this.oldFill = this.maxHealth; this.playerHealthText.text = this.playerHealth.ToString(); }
// Start is called before the first frame update void Start() { try { //Set tooltips to inactive to start this.tooltipBalance.SetActive(false); if (this.tooltipHighScore != null) { this.tooltipHighScore.SetActive(false); } //If the player is just starting out with no money accumulated, then provide $30 to start off if (PlayerPrefs.GetInt("moneyBalance") < 30) { PlayerPrefs.SetInt("moneyBalance", 30); PlayerPrefs.Save(); } //Load in the saved money balance just before the current game session begins this.moneyBalance = PlayerPrefs.GetInt("moneyBalance"); this.moneyBalanceText.text = this.moneyBalance.ToString(); //Load in saved high score of money collected just before the current game session begins this.moneyHighScore = PlayerPrefs.GetInt("moneyHighScore"); if (this.moneyHighScoreText != null) { this.moneyHighScoreText.text = this.moneyHighScore.ToString(); } //Display amount collected just before current game begins if (this.moneyCollectedText != null) { this.moneyCollectedText.text = this.moneyCollected.ToString(); } } catch (Exception e) { Debug.LogException(e); } //Get instance associated with EaseTweenManager gameObject try { this.tween = GameObject.FindObjectOfType <EaseTweenManager>(); } catch (Exception e) { } }