From 6b6ecf593e02ad9e85e58bfa08ea8b286c70666b Mon Sep 17 00:00:00 2001 From: yzx Date: Thu, 11 Jan 2024 15:21:56 +0800 Subject: [PATCH] t --- U3D_DrivingSystem/Assets/Scenes/main_.unity | 1 + .../Assets/Script/Manaegr/CarInputManager.cs | 27 ++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/U3D_DrivingSystem/Assets/Scenes/main_.unity b/U3D_DrivingSystem/Assets/Scenes/main_.unity index e50a3dc8..73eb4d46 100644 --- a/U3D_DrivingSystem/Assets/Scenes/main_.unity +++ b/U3D_DrivingSystem/Assets/Scenes/main_.unity @@ -397346,6 +397346,7 @@ MonoBehaviour: cam2: {fileID: 1785647646} menuUI: {fileID: 1648579876} carInfoUI: {fileID: 1944520099} + ygq: {fileID: 1559914993} --- !u!1 &1277129999 GameObject: m_ObjectHideFlags: 0 diff --git a/U3D_DrivingSystem/Assets/Script/Manaegr/CarInputManager.cs b/U3D_DrivingSystem/Assets/Script/Manaegr/CarInputManager.cs index 3923483a..dba97110 100644 --- a/U3D_DrivingSystem/Assets/Script/Manaegr/CarInputManager.cs +++ b/U3D_DrivingSystem/Assets/Script/Manaegr/CarInputManager.cs @@ -16,6 +16,12 @@ namespace Script.Manaegr public GameObject menuUI; public GameObject carInfoUI; + + + public AnimationController ygq; + + private bool isYgq = false; + public void Init() { vehicleController.maxSpeedForward = 11; @@ -41,7 +47,7 @@ namespace Script.Manaegr } - + //切换车内视角 if (Input.GetKeyDown(KeyCode.U)) { if (cam1.activeInHierarchy) @@ -55,6 +61,22 @@ namespace Script.Manaegr cam2.SetActive(false); } } + //雨刮器 + if (Input.GetKeyDown(KeyCode.I)) + { + if (!isYgq) + { + isYgq = true; + ygq.PlayAnimation("donghua"); + } + else + { + isYgq = false; + ygq.StopAnimationLoop(); + } + } + + //菜单 if (Input.GetKeyDown(KeyCode.Escape)) { if (menuUI.activeInHierarchy) @@ -66,6 +88,9 @@ namespace Script.Manaegr menuUI.SetActive(true); } } + + + } } } \ No newline at end of file