加速跑计时与跳跃互斥
This commit is contained in:
parent
4fe36027f0
commit
35376ca10d
@ -300,7 +300,8 @@ namespace Game
|
||||
mRigidbody.isKinematic = false;
|
||||
mRigidbody.useGravity = true;
|
||||
|
||||
mRigidbody.constraints = RigidbodyConstraints.FreezeRotation;
|
||||
//禁止碰撞引起旋转 和 Z轴变化
|
||||
mRigidbody.constraints = RigidbodyConstraints.FreezeRotation | RigidbodyConstraints.FreezePositionZ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -182,7 +182,7 @@ namespace Game
|
||||
else
|
||||
{
|
||||
//如果超过移动时间
|
||||
if(MoveTime > ConstClass.ToFastModeTime
|
||||
if(GroundMoveTime > ConstClass.ToFastModeTime
|
||||
//&& PlayData.skill.hadskillid.Contains(5)//判断是否有加速技能
|
||||
)
|
||||
IsFastSkillMode = true;
|
||||
|
||||
@ -139,7 +139,6 @@ namespace Game
|
||||
#region 移动
|
||||
|
||||
private bool mIsMove = false;
|
||||
public float MoveTime = 0;
|
||||
|
||||
public bool IsMove
|
||||
{
|
||||
@ -149,12 +148,12 @@ namespace Game
|
||||
mIsMove = value;
|
||||
if (value)//刚开始移动
|
||||
{
|
||||
MoveTime = 0;
|
||||
GroundMoveTime = 0;
|
||||
MeshChangeMoveState(true);
|
||||
}
|
||||
else//刚停止移动
|
||||
{
|
||||
MoveTime = 0;
|
||||
GroundMoveTime = 0;
|
||||
//Move_currentVector = Vector3.zero;//清空移动方向
|
||||
Move_currentVector.x = 0;//清空移动方向
|
||||
MeshChangeMoveState(false);
|
||||
@ -164,6 +163,9 @@ namespace Game
|
||||
}
|
||||
|
||||
|
||||
public float GroundMoveTime = 0;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 朝向
|
||||
/// </summary>
|
||||
@ -174,7 +176,7 @@ namespace Game
|
||||
set{ if (mIsLeft != value)
|
||||
{
|
||||
mIsLeft = value;
|
||||
MoveTime = 0;//朝向变化时,重置移动时间
|
||||
GroundMoveTime = 0;//朝向变化时,重置移动时间
|
||||
if (value)//开始往右
|
||||
MeshChangeDir(true);
|
||||
else//开始往左
|
||||
@ -226,7 +228,14 @@ namespace Game
|
||||
/// </summary>
|
||||
void FixedUpdate_Move()
|
||||
{
|
||||
if (IsMove) MoveTime += Time.deltaTime;
|
||||
if (IsMove)
|
||||
{
|
||||
//跳跃时,不追加地面移动时间
|
||||
if (JumpStep == E_JUMP_STEP.None)
|
||||
GroundMoveTime += Time.deltaTime;
|
||||
else
|
||||
GroundMoveTime = 0;
|
||||
}
|
||||
|
||||
Vector3 _playerPos = mRigidbody.position;
|
||||
_playerPos += Move_currentVector * Move_BaseSpeed * Move_SpeedMultiplier * Time.deltaTime;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user