diff --git a/U3D_DrivingSystem/Assets/Scenes/main_.unity b/U3D_DrivingSystem/Assets/Scenes/main_.unity index 06c33652..b669b450 100644 --- a/U3D_DrivingSystem/Assets/Scenes/main_.unity +++ b/U3D_DrivingSystem/Assets/Scenes/main_.unity @@ -441160,8 +441160,8 @@ MonoBehaviour: shache: - {fileID: 469820069} - {fileID: 1337615172} - ui3d: {fileID: 0} - ui2d: {fileID: 0} + ui3d: {fileID: 67935768} + ui2d: {fileID: 1944520099} --- !u!1 &1276928531 GameObject: m_ObjectHideFlags: 0 @@ -457133,6 +457133,7 @@ MonoBehaviour: mesh: {fileID: -7193705671270685957, guid: efe2b86486a526a4e809023d89746bad, type: 3} meshFilter: {fileID: 468594977} animator: {fileID: 34988786} + isOpen: 1 --- !u!1 &1323235811 GameObject: m_ObjectHideFlags: 0 @@ -712513,7 +712514,7 @@ PrefabInstance: - target: {fileID: 4279975699638886894, guid: 4292160a5e1fde347934ac660b2c5d30, type: 3} propertyPath: m_LocalPosition.y - value: 1.313 + value: 1.34 objectReference: {fileID: 0} - target: {fileID: 4279975699638886894, guid: 4292160a5e1fde347934ac660b2c5d30, type: 3} diff --git a/U3D_DrivingSystem/Assets/Script/AccidentManager.cs b/U3D_DrivingSystem/Assets/Script/AccidentManager.cs index 4916a370..5c4441b2 100644 --- a/U3D_DrivingSystem/Assets/Script/AccidentManager.cs +++ b/U3D_DrivingSystem/Assets/Script/AccidentManager.cs @@ -23,7 +23,8 @@ public class AccidentManager : MonoBehaviour public Animator animator; // 将Animator组件拖拽到这个字段 private bool isPlaying = false; - + + public bool isOpen = true; public void Close() { for (int i = 0; i < uis.transform.Find("UI").childCount; i++) @@ -47,6 +48,10 @@ public class AccidentManager : MonoBehaviour public async Task Tr(Transform other, bool b = false) { + + if (isOpen) + return; + triggerName = other.name; @@ -102,6 +107,8 @@ public class AccidentManager : MonoBehaviour PlayAnimationSequence("MsgWinAnimOpen", "MsgWinAnimClose"); uis.transform.Find("UI").Find("刹车失灵").gameObject.SetActive(true); } + + } IEnumerator dengdai() { @@ -150,7 +157,7 @@ public class AccidentManager : MonoBehaviour //MBOXManager.Instance.Bonk(); Tr(other.transform); - + // switch (other.name) // { // case "刹车失灵": @@ -196,12 +203,16 @@ public class AccidentManager : MonoBehaviour // 用于外部调用的方法,启动动画序列 public void PlayAnimationSequence(string firstAnimation, string secondAnimation) { + Close(); + + if (!isPlaying) { Debug.Log("12312312312312312321"); StartCoroutine(PlayAnimations(firstAnimation, secondAnimation)); } + } // 协程,按顺序播放动画,并在两个动画之间等待 @@ -222,6 +233,8 @@ public class AccidentManager : MonoBehaviour // 等待第二个动画播放完毕 yield return new WaitUntil(() => !animator.GetCurrentAnimatorStateInfo(0).IsName(secondAnimation)); + yield return new WaitForSeconds(20); + isPlaying = false; } diff --git a/U3D_DrivingSystem/Assets/Script/Manaegr/CarInputManager.cs b/U3D_DrivingSystem/Assets/Script/Manaegr/CarInputManager.cs index bf0fe634..185f80de 100644 --- a/U3D_DrivingSystem/Assets/Script/Manaegr/CarInputManager.cs +++ b/U3D_DrivingSystem/Assets/Script/Manaegr/CarInputManager.cs @@ -26,8 +26,7 @@ namespace Script.Manaegr private bool isYgq = false; - - + public void Init() { diff --git a/U3D_DrivingSystem/Assets/Script/SteeringWheelController.cs b/U3D_DrivingSystem/Assets/Script/SteeringWheelController.cs index 7c83d794..d5213784 100644 --- a/U3D_DrivingSystem/Assets/Script/SteeringWheelController.cs +++ b/U3D_DrivingSystem/Assets/Script/SteeringWheelController.cs @@ -220,7 +220,7 @@ public class SteeringWheelController : MonoBehaviour /// 下一个按钮 /// private void SelectNextButton() - { + { selectedButtonIndex = (selectedButtonIndex + 1) % buttons.Length; // Debug.Log("前进" + selectedButtonIndex); HighlightButton(selectedButtonIndex); diff --git a/U3D_DrivingSystem/obj/Debug/AmplifyShaderEditor.csproj.AssemblyReference.cache b/U3D_DrivingSystem/obj/Debug/AmplifyShaderEditor.csproj.AssemblyReference.cache index 4b5f6806..69854011 100644 Binary files a/U3D_DrivingSystem/obj/Debug/AmplifyShaderEditor.csproj.AssemblyReference.cache and b/U3D_DrivingSystem/obj/Debug/AmplifyShaderEditor.csproj.AssemblyReference.cache differ diff --git a/U3D_DrivingSystem/obj/Debug/Assembly-CSharp-Editor.csproj.AssemblyReference.cache b/U3D_DrivingSystem/obj/Debug/Assembly-CSharp-Editor.csproj.AssemblyReference.cache index 55b102c3..bd6dbae8 100644 Binary files a/U3D_DrivingSystem/obj/Debug/Assembly-CSharp-Editor.csproj.AssemblyReference.cache and b/U3D_DrivingSystem/obj/Debug/Assembly-CSharp-Editor.csproj.AssemblyReference.cache differ diff --git a/U3D_DrivingSystem/obj/Debug/Boxophobic.AtmosphericHeightFog.Editor.csproj.AssemblyReference.cache b/U3D_DrivingSystem/obj/Debug/Boxophobic.AtmosphericHeightFog.Editor.csproj.AssemblyReference.cache index 4b5f6806..69854011 100644 Binary files a/U3D_DrivingSystem/obj/Debug/Boxophobic.AtmosphericHeightFog.Editor.csproj.AssemblyReference.cache and b/U3D_DrivingSystem/obj/Debug/Boxophobic.AtmosphericHeightFog.Editor.csproj.AssemblyReference.cache differ diff --git a/U3D_DrivingSystem/obj/Debug/Boxophobic.AtmosphericHeightFog.Runtime.csproj.AssemblyReference.cache b/U3D_DrivingSystem/obj/Debug/Boxophobic.AtmosphericHeightFog.Runtime.csproj.AssemblyReference.cache index 6db14989..a1f68d66 100644 Binary files a/U3D_DrivingSystem/obj/Debug/Boxophobic.AtmosphericHeightFog.Runtime.csproj.AssemblyReference.cache and b/U3D_DrivingSystem/obj/Debug/Boxophobic.AtmosphericHeightFog.Runtime.csproj.AssemblyReference.cache differ diff --git a/U3D_DrivingSystem/obj/Debug/Boxophobic.Utils.Editor.csproj.AssemblyReference.cache b/U3D_DrivingSystem/obj/Debug/Boxophobic.Utils.Editor.csproj.AssemblyReference.cache index 4b5f6806..69854011 100644 Binary files a/U3D_DrivingSystem/obj/Debug/Boxophobic.Utils.Editor.csproj.AssemblyReference.cache and b/U3D_DrivingSystem/obj/Debug/Boxophobic.Utils.Editor.csproj.AssemblyReference.cache differ diff --git a/U3D_DrivingSystem/obj/Debug/Boxophobic.Utils.Scripts.csproj.AssemblyReference.cache b/U3D_DrivingSystem/obj/Debug/Boxophobic.Utils.Scripts.csproj.AssemblyReference.cache index 6db14989..a1f68d66 100644 Binary files a/U3D_DrivingSystem/obj/Debug/Boxophobic.Utils.Scripts.csproj.AssemblyReference.cache and b/U3D_DrivingSystem/obj/Debug/Boxophobic.Utils.Scripts.csproj.AssemblyReference.cache differ