Ejemplo n.º 1
0
        public override Command GetAction(Transform player)
        {
            if (!meleeAI)
            {
                meleeAI = player.GetComponent <MeleeCircleAI> ();
            }

            return(null);
        }
Ejemplo n.º 2
0
        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);
        }