public Attacking(GameObject obj) { this.obj = obj; ctrl = this.obj.GetComponent <NewMinionCtrl>(); anim = this.obj.GetComponent <Animator>(); // by default we dont have a target attackTarget = null; }
public Walking(GameObject obj) { this.obj = obj; // set references ctrl = this.obj.GetComponent <NewMinionCtrl>(); rb = this.obj.GetComponent <Rigidbody>(); anim = this.obj.GetComponent <Animator>(); // Set the initial target to null target = null; }
NewMinionCtrl ctrl; // reference to the minion controller public IdleState(GameObject obj) { this.obj = obj; ctrl = this.obj.GetComponent <NewMinionCtrl>(); anim = this.obj.GetComponent <Animator>(); }
private void Awake() { minCtrl = GetComponentInParent <NewMinionCtrl>(); obj = minCtrl.gameObject; aggroCollider = gameObject.GetComponent <SphereCollider>(); }