void Start() { owner = GetComponentInParent <Unit>(); ac = owner.GetComponentInChildren <AbilityCatalog>(); bc = gameObject.transform.parent.parent.parent.parent.gameObject.GetComponent <BattleController>(); bmc = bc.GetComponentInChildren <BattleMessageController>(); cp = bc.gameObject.GetComponent <ComputerPlayer>(); }
public void Place(Tile target) { // Make sure old tile location is not still pointing to this unit if (tile != null && tile.content == gameObject) { tile.content = null; } // Link unit and tile references tile = target; if (target != null) { target.content = gameObject; } bmc = gameObject.transform.parent.parent.gameObject.GetComponentInChildren <BattleMessageController>(); }