Commit 37699eda authored by czy's avatar czy

游戏结束后的滑行效果

parent e5e98b85
......@@ -4700,6 +4700,11 @@ PrefabInstance:
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 8161822684297487994, guid: e808ab909854dca4dba20c69399d6a13,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8639644498048831415, guid: e808ab909854dca4dba20c69399d6a13,
type: 3}
propertyPath: m_Mesh
......
......@@ -232,11 +232,11 @@ public class AIMove : MonoBehaviour
isAddSpeed = true;
return;
}
if (BattleCtrl.instance.isEndBattle)
{
isAddSpeed = true;
return;
}
//if (BattleCtrl.instance.isEndBattle)
//{
// isAddSpeed = true;
// return;
//}
if (targetObj == null)
{
targetObj = GetTargetPos();
......@@ -339,6 +339,16 @@ public class AIMove : MonoBehaviour
timerVertigo -= Time.deltaTime;
}
}
else
{
//游戏已经结束但可以继续滑行
//print("游戏已经结束但可以继续滑行"); //Move((transform.forward * MoveSpeed + new Vector3(0, _vertSpeed, 0)) * Time.deltaTime + (new Vector3(xDelta, 0, 0)));
if (characterController.velocity.z >= 0)
{
characterController.SimpleMove(new Vector3(0, 0, characterController.velocity.z - 15 * Time.deltaTime));
}
}
}
......
......@@ -18,6 +18,11 @@ public class EndPoint : MonoBehaviour
}
private void OnTriggerEnter(Collider other)
{
if (!BattleCtrl.instance.isStartBattle|| BattleCtrl.instance.isEndBattle)
{
return;
}
if (other.tag == "Player")
{
//游戏胜利
......
......@@ -73,7 +73,6 @@ public class PlayerMove : MonoBehaviour
private Dictionary<Rigidbody, bool> m_dicRigidDic = new Dictionary<Rigidbody, bool>();
private bool isGround1 = true;
private bool isGround2 = true;
private bool isAddSpeed = true;
private float timer = 0.0f;
//输入控制player移动的中间变量
......@@ -231,14 +230,17 @@ public class PlayerMove : MonoBehaviour
if (!BattleCtrl.instance.isStartBattle)
{
isAddSpeed = true;
return;
}
if (BattleCtrl.instance.isEndBattle)
{
isAddSpeed = true;
//游戏没有开始
return;
}
//if (BattleCtrl.instance.isEndBattle)
//{
// //游戏没有结束
// return;
//}
//移动
MoveSpeed = VSpeed + (AddSpeed * (SpeedLevel-1));
//是否在地面
......@@ -248,7 +250,7 @@ public class PlayerMove : MonoBehaviour
animator.SetBool("Grounded", Grounded);
//不在地面上给物体添加一个模拟重力
if (!Grounded)
{
_vertSpeed += -9.8f * 5 * Time.deltaTime;
......@@ -315,6 +317,16 @@ public class PlayerMove : MonoBehaviour
timerVertigo -= Time.deltaTime;
xDelta = 0;//避免眩晕期间不会执行UpdateJoystick();造成偏移现象。
}
}
else
{
//游戏已经结束但可以继续滑行
//print("游戏已经结束但可以继续滑行"); //Move((transform.forward * MoveSpeed + new Vector3(0, _vertSpeed, 0)) * Time.deltaTime + (new Vector3(xDelta, 0, 0)));
if (characterController.velocity.z >= 0)
{
characterController.SimpleMove(new Vector3(0, 0, characterController.velocity.z - 15 * Time.deltaTime));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment