public override Command GetAction(Transform player) { if (!meleeAI) { meleeAI = player.GetComponent <MeleeCircleAI> (); } return(null); }
public override void Exit() { if (!meleeAI) { var player = GameObject.FindGameObjectWithTag("Player"); if (player) { meleeAI = player.GetComponent <MeleeCircleAI> (); } } meleeAI.CompletedAttack(); }
public override bool ChangeState(Transform player) { currentWaitTime += Time.deltaTime; if (!circleAI) { circleAI = player.GetComponent <MeleeCircleAI> (); } if (OkToAct() && circleAI.HavePermissionToAttack()) { Debug.Log(SCRIPT_NAME + ": switching state to: " + GoToState); controller.SetTransistion(Transition); return(true); } return(false); }