public void Awake() { DontDestroyOnLoad(this); if (FindObjectsOfType(GetType()).Length > 1) { Destroy(gameObject); } GameObject menuControls = GameObject.Find("menuControls"); menu = menuControls.GetComponent <startOver>(); }
// Use this for initialization void Start() { GameObject gameControllerObject = GameObject.FindWithTag("GameController"); if (gameControllerObject != null) { score = gameControllerObject.GetComponent <scoreController>(); } if (score == null) { Debug.Log("Cannot find 'GameController' script"); } GameObject menuControls = GameObject.Find("menuControls"); menu = menuControls.GetComponent <startOver>(); menu.startScreen(); }