public void FindClickOnEggScript() { clickOnEggsScript = null; if (GameObject.Find("Game Engine")) { clickOnEggsScript = GameObject.Find("Game Engine").GetComponent <ClickOnEggs>(); } }
public void FindClickOnEggScript() { clickOnEggsScript = null; // Change to find a tag or something. OR Have the clickOnEggScript give itself to GlobalVariables on awake. if (GameObject.Find("Game Engine")) { clickOnEggsScript = GameObject.Find("Game Engine").GetComponent <ClickOnEggs>(); } }