Commit 37699eda authored by czy's avatar czy

游戏结束后的滑行效果

parent e5e98b85
...@@ -4700,6 +4700,11 @@ PrefabInstance: ...@@ -4700,6 +4700,11 @@ PrefabInstance:
propertyPath: m_Mesh propertyPath: m_Mesh
value: value:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8161822684297487994, guid: e808ab909854dca4dba20c69399d6a13,
type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8639644498048831415, guid: e808ab909854dca4dba20c69399d6a13, - target: {fileID: 8639644498048831415, guid: e808ab909854dca4dba20c69399d6a13,
type: 3} type: 3}
propertyPath: m_Mesh propertyPath: m_Mesh
......
...@@ -232,11 +232,11 @@ public class AIMove : MonoBehaviour ...@@ -232,11 +232,11 @@ public class AIMove : MonoBehaviour
isAddSpeed = true; isAddSpeed = true;
return; return;
} }
if (BattleCtrl.instance.isEndBattle) //if (BattleCtrl.instance.isEndBattle)
{ //{
isAddSpeed = true; // isAddSpeed = true;
return; // return;
} //}
if (targetObj == null) if (targetObj == null)
{ {
targetObj = GetTargetPos(); targetObj = GetTargetPos();
...@@ -339,6 +339,16 @@ public class AIMove : MonoBehaviour ...@@ -339,6 +339,16 @@ public class AIMove : MonoBehaviour
timerVertigo -= Time.deltaTime; 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 ...@@ -18,6 +18,11 @@ public class EndPoint : MonoBehaviour
} }
private void OnTriggerEnter(Collider other) private void OnTriggerEnter(Collider other)
{ {
if (!BattleCtrl.instance.isStartBattle|| BattleCtrl.instance.isEndBattle)
{
return;
}
if (other.tag == "Player") if (other.tag == "Player")
{ {
//游戏胜利 //游戏胜利
......
...@@ -73,7 +73,6 @@ public class PlayerMove : MonoBehaviour ...@@ -73,7 +73,6 @@ public class PlayerMove : MonoBehaviour
private Dictionary<Rigidbody, bool> m_dicRigidDic = new Dictionary<Rigidbody, bool>(); private Dictionary<Rigidbody, bool> m_dicRigidDic = new Dictionary<Rigidbody, bool>();
private bool isGround1 = true; private bool isGround1 = true;
private bool isGround2 = true; private bool isGround2 = true;
private bool isAddSpeed = true;
private float timer = 0.0f; private float timer = 0.0f;
//输入控制player移动的中间变量 //输入控制player移动的中间变量
...@@ -231,14 +230,17 @@ public class PlayerMove : MonoBehaviour ...@@ -231,14 +230,17 @@ public class PlayerMove : MonoBehaviour
if (!BattleCtrl.instance.isStartBattle) if (!BattleCtrl.instance.isStartBattle)
{ {
isAddSpeed = true; //游戏没有开始
return;
}
if (BattleCtrl.instance.isEndBattle)
{
isAddSpeed = true;
return; return;
} }
//if (BattleCtrl.instance.isEndBattle)
//{
// //游戏没有结束
// return;
//}
//移动 //移动
MoveSpeed = VSpeed + (AddSpeed * (SpeedLevel-1)); MoveSpeed = VSpeed + (AddSpeed * (SpeedLevel-1));
//是否在地面 //是否在地面
...@@ -248,7 +250,7 @@ public class PlayerMove : MonoBehaviour ...@@ -248,7 +250,7 @@ public class PlayerMove : MonoBehaviour
animator.SetBool("Grounded", Grounded); animator.SetBool("Grounded", Grounded);
//不在地面上给物体添加一个模拟重力
if (!Grounded) if (!Grounded)
{ {
_vertSpeed += -9.8f * 5 * Time.deltaTime; _vertSpeed += -9.8f * 5 * Time.deltaTime;
...@@ -317,6 +319,16 @@ public class PlayerMove : MonoBehaviour ...@@ -317,6 +319,16 @@ public class PlayerMove : MonoBehaviour
} }
} }
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