void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Destroy(gameObject); } if (SceneManager.GetActiveScene().name == "Result") { NumberOfStepsText.text = Instance.AmountOfStepsTaken.ToString(); } else if (SceneManager.GetActiveScene().name == "Main") { Instance = null; } }
// Use this for initialization void Awake() { numWiz = GameObject.Find("NumberWizard").GetComponent <NumberWizard>(); }
void Start() { guessCount.text = NumberWizard.GetGuessCount(); }
// Start is called before the first frame update void Start() { int guessNum = NumberWizard.GetGuessCounter(); guessTextCounter.text = guessNum.ToString(); }