コード例 #1
0
        /**移动**/

        protected override void Move()
        {
            if (StatuController != null && StatuController.GetAnimator() != null &&
                StatuController.GetAnimator().speed <= 0)
            {
                return;
            }
            if (_isSynMove)
            {
                MoveByDir();
            }
            if (GetMeVo() != null && !GetMeVo().IsHitRecover&& (IsFloating() || GetMeVo().FloatingYSpeed != 0f || GetMeVo().FloatingXSpeed != 0f))
            {
                var     meVo   = GetMeVo();
                Vector3 pos    = Vector3.zero;
                float   ySpeed = 0f;
                GamePhysics.CalculateParabolic(GetMePos(), meVo.FloatingXSpeed, meVo.FloatingYSpeed, meVo.AtkerDirection, GamePhysics.Gravity, out pos, out ySpeed);
                Me.Pos(pos.x, pos.y, pos.z);
                meVo.FloatingYSpeed = ySpeed;
                if (!IsFloating())                                    //不再浮空的话把属性清0
                {
                    if (StatuController.CurrentStatu == Status.HURT4) //击飞状态中
                    {
                        StatuController.SetStatu(Status.HURTDOWN);
                    }
                    meVo.FloatingXSpeed = 0f;
                    meVo.FloatingYSpeed = 0f;
                    meVo.AtkerDirection = 0;
                }
            }
            if (IsWalking)
            {
                MoveForward();
            }
        }