void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else if (instance != this) { Destroy(gameObject); } }
// Use this for initialization void Start() { masterTracker = GetComponent <MasterTracker>(); smallTankPointsWorth = masterTracker.SmallTankPointsWorth; fastTankPointsWorth = masterTracker.FastTankPointsWorth; bigTankPointsWorth = masterTracker.BigTankPointsWorth; armoredTankPointsWorth = masterTracker.armoredTankPointsWorth; stageText.text = "STAGE " + MasterTracker.stageNumber; playerScoreText.text = MasterTracker.playerScore.ToString(); hiScoreText.text = highscore.ToString(); StartCoroutine(UpdateTankPoints()); }