void OnTriggerEnter2D(Collider2D otherCollider) { buildingScript building = otherCollider.gameObject.GetComponent <buildingScript> (); if (building != null) { building.hasReturned = true; } }
// Use this for initialization void Start() { planningStage = true; canMoveArrows = true; arrowCounter = GameObject.FindGameObjectsWithTag("arrow"); arrowCount = arrowCounter.Length; GameObject buildingObject = GameObject.Find("Building"); if (buildingObject != null) { building = buildingObject.GetComponent <buildingScript>(); } mineralCounter = GameObject.FindGameObjectsWithTag("Pick-up"); mineralsTotal = mineralCounter.Length; }