public virtual void Attack2Command()
 {
     if (EnemyState != EnemyAction.Cooldown)
     {
         command = EnemyCommands.Attack2;
     }
 }
        protected void Attack(float power)
        {
            /*
             * HitController[] hcontrollers = gameObject.GetComponentsInChildren<HitController>();
             * HitController hcontrollerL = null;
             * HitController hcontrollerR = null;
             *
             * foreach (HitController hcontroller in hcontrollers)
             * {
             *  if (hcontroller.gameObject.tag == "hitRight")
             *  {
             *      hcontrollerR = hcontroller;
             *  }
             *  else if (hcontroller.gameObject.tag == "hitLeft")
             *  {
             *      hcontrollerL = hcontroller;
             *  }
             * }
             */
            PlayAttack();

            /*
             * if (CanHit && AimHit != null)
             * {
             *  HittableController hController = AimHit.GetComponent<HittableController>();
             *  if (hController != null)
             *  {
             *      if (FacingRight)
             *      {
             *          if (hcontrollerR != null)
             *          {
             *              hcontrollerR.GetActionHit();
             *          }
             *      }
             *      else
             *      {
             *          if (hcontrollerL != null)
             *          {
             *              hcontrollerL.GetActionHit();
             *          }
             *      }
             *      hController.GettingHit(power);
             *  }
             * }
             */
            command = EnemyCommands.Idle;
        }
Пример #3
0
    public override void OnStateEnter(Animator animator, AnimatorStateInfo animatorStateInfo, int layerIndex)
    {
        commands = animator.GetComponent <EnemyCommands>();

        commands.Commands[command].Invoke();
    }
 public void MoveBackCommand()
 {
     command = EnemyCommands.MoveBack;
 }
 public void MoveCommand()
 {
     command = EnemyCommands.Move;
 }
 public void IdleCommand()
 {
     command = EnemyCommands.Idle;
 }