Пример #1
0
        protected void UpdateAttackMove()
        {
            foreach (MonsterAttackMove move in m_AttackMoveList)
            {
                if (move.MoveCooldownTimer > 0 && !move.OnMoving)
                {
                    move.MoveCooldownTimer -= Time.deltaTime;
                    move.FacingRight        = FacingRight;
                }
            }

            if (m_CurrentAttackMove != null)
            {
                return;
            }

            foreach (MonsterAttackMove move in m_AttackMoveList)
            {
                if (move.CanMove() &&
                    (move.HasTarget() || move.CanMoveWithoutTarget))
                {
                    m_CurrentAttackMove = move;
                    StartMoveAttack();
                    return;
                }
            }
        }
Пример #2
0
        public void CancelMove()
        {
            if (m_CurrentAttackMove == null)
            {
                return;
            }

            m_CurrentAttackMove.OnMoving = false;
            m_CurrentAttackMove          = null;
        }