/**移动**/ 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(); } }
/**停止移动**/ public void StopWalk() { IsWalking = false; if (StatuController != null && StatuController.CurrentStatu == Status.RUN) { StatuController.SetStatu(Status.IDLE); } if (_moveEndCallback != null) { _moveEndCallback(this); } _moveEndCallback = null; Me.SetSortingOrder(false); }
/// <summary> /// 移动到某一个位置 /// </summary> /// <param name="x">X坐标</param> /// <param name="y">Y坐标</param> /// <param name="callback">移动完后的回调处理</param> public override void MoveTo(float x, float y, MoveEndCallback callback = null) { if (CanMove) { Target.x = x; Target.y = y; Target = AdjustVector3(Target); _moveEndCallback = callback; if (StatuController != null) { StatuController.SetStatu(Status.RUN); } IsWalking = true; } }
public void Relive() { StatuController.SetStatu(Status.IDLE); }