void Start() { try { dontDesroyScript_ = GameObject.FindGameObjectWithTag("DontDestroy").GetComponent <DontDestroyOnLoadScript>(); score = dontDesroyScript_.Score; maxScore = dontDesroyScript_.MaxScore; } catch { score = 1995; maxScore = 4000; } updateScoreBoard(); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
private void Start() { bagText.text = playerHarvest + " / " + bagCapacity; scoreText.text = playerScore + " / " + GameManager.instance.PointsToWin; DisablePlantIcon(); DisableHarvestIcon(); try { dontDesroyScript_ = GameObject.FindGameObjectWithTag("DontDestroy").GetComponent <DontDestroyOnLoadScript>(); } catch { } UpdateEndGameScores(); }
void Awake() { if (instance != null) { Destroy(gameObject); } else { instance = this; GameObject.DontDestroyOnLoad(gameObject); } }
// Use this for initialization void Start() { instance = this; }