private void Start() { team = this.transform.root.GetComponent <TeamScript>().team; agent = this.gameObject.GetComponent <NavMeshAgent>(); stats = this.GetComponent <Unit_Statistics>(); }
private void Awake() { gm = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); tm = gm.GetComponentInChildren <TeamManager>(); life = this.GetComponent <Unit_Life>(); stats = this.gameObject.GetComponent <Unit_Statistics>(); attack = this.gameObject.GetComponent <Unit_Attack>(); movement = this.gameObject.GetComponent <Unit_Movement>(); }