private void DestroyThis() { actions.CancelAttack(); state.RemoveUnit(this.gameObject); this.transform.parent = null; state.selection.CleanupSelection(this); FlagActions flag = null; if (GetComponent <SoldierActions> () != null && (flag = GetComponentInChildren <FlagActions> ()) != null) { flag.getDropped(); flag.transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z); } Destroy(this.gameObject); }
public void returnFlag() { flag.getDropped(); flagIsHome = true; flag.transform.position = flagPos; }