// Use this for initialization void Start() { currentButtons = new List <GameObject> (); tc = tcObject.GetComponent <TurnController> (); sm = tcObject.GetComponent <SimulationManager> (); planetPointer = GameObject.FindGameObjectWithTag("PlanetPointer").GetComponent <PlanetPointer> (); foreach (GameObject g in GameObject.FindGameObjectsWithTag("MainMenuButton")) { currentButtons.Add(g); } Debug.Log(currentButtons.Count); ActiveMenuRootObject = MainMenuRootObject; spaceBarn = GameObject.FindGameObjectWithTag("SpaceBarn").GetComponent <SpaceBarn> (); }
// Use this for initialization void Start() { sBarn = GameObject.FindGameObjectWithTag("SpaceBarn").GetComponent <SpaceBarn>(); txt = GetComponent <Text> (); txt.text = "SpaceBerries:\n" + sBarn.spaceBerries; }