From ea6b75d73de37f27b88f002b5e47067251bdeda6 Mon Sep 17 00:00:00 2001 From: Ding Yuntian <1491671119@qq.com> Date: Fri, 10 Jul 2026 18:58:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(record):=20=E5=A2=9E=E5=8A=A0=E5=BD=95?= =?UTF-8?q?=E5=88=B6=E6=A8=A1=E5=BC=8F=EF=BC=8C=E6=8C=89ctrl+R?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Framework/LogKit/VerText.cs | 14 ++++++++++++- Assets/Scripts/Game Loop/EventEnums.cs | 5 +++++ Assets/Scripts/UI/Cursor/CursorManager.cs | 23 ++++++++++++++++++++++ Assets/Scripts/UI/UIManager.cs | 8 ++++++++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Framework/LogKit/VerText.cs b/Assets/Scripts/Framework/LogKit/VerText.cs index 29eb4f7b7..73c214e97 100644 --- a/Assets/Scripts/Framework/LogKit/VerText.cs +++ b/Assets/Scripts/Framework/LogKit/VerText.cs @@ -1,3 +1,4 @@ +using AibisDream.Framework; using TMPro; using UnityEngine; @@ -5,9 +6,20 @@ namespace AibisDream.Kit { public class VerText : MonoBehaviour { - void Start() + private void Start() { GetComponent().text = $"Ver.{Application.version}"; + EnumEventSystem.Global.Register(UIEventEnum.RecordingModeChanged, OnRecordingModeChanged); + } + + private void OnDestroy() + { + EnumEventSystem.Global.UnRegister(UIEventEnum.RecordingModeChanged, OnRecordingModeChanged); + } + + private void OnRecordingModeChanged(bool isRecording) + { + gameObject.SetActive(!isRecording); } } } diff --git a/Assets/Scripts/Game Loop/EventEnums.cs b/Assets/Scripts/Game Loop/EventEnums.cs index 2946a9a8d..5d2de24f6 100644 --- a/Assets/Scripts/Game Loop/EventEnums.cs +++ b/Assets/Scripts/Game Loop/EventEnums.cs @@ -98,4 +98,9 @@ namespace AibisDream PauseMenuAmbEnter, PauseMenuAmbExit, } + + public enum UIEventEnum + { + RecordingModeChanged + } } diff --git a/Assets/Scripts/UI/Cursor/CursorManager.cs b/Assets/Scripts/UI/Cursor/CursorManager.cs index 0fd4fad2f..b67607e3d 100644 --- a/Assets/Scripts/UI/Cursor/CursorManager.cs +++ b/Assets/Scripts/UI/Cursor/CursorManager.cs @@ -23,6 +23,29 @@ namespace AibisDream #else InitCursor(); #endif + EnumEventSystem.Global.Register(UIEventEnum.RecordingModeChanged, OnRecordingModeChanged); + } + + private void OnDestroy() + { + EnumEventSystem.Global.UnRegister(UIEventEnum.RecordingModeChanged, OnRecordingModeChanged); + } + + private void OnRecordingModeChanged(bool isRecording) + { +#if UNITY_ANDROID || UNITY_IOS + return; +#endif + + if (_cursor != null) + { + _cursor.gameObject.SetActive(!isRecording); + } + + if (isRecording) + { + Cursor.visible = false; + } } private void InitCursor() diff --git a/Assets/Scripts/UI/UIManager.cs b/Assets/Scripts/UI/UIManager.cs index 59c723cb5..77aa70056 100644 --- a/Assets/Scripts/UI/UIManager.cs +++ b/Assets/Scripts/UI/UIManager.cs @@ -23,6 +23,7 @@ namespace AibisDream public RectTransform DialogCanvas { get; private set; } private GraphicRaycaster _raycaster; + private bool _isRecordingMode; #endregion @@ -63,6 +64,13 @@ namespace AibisDream ShowPanel(); } } + + if ((Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) + && Input.GetKeyDown(KeyCode.R)) + { + _isRecordingMode = !_isRecordingMode; + EnumEventSystem.Global.Send(UIEventEnum.RecordingModeChanged, _isRecordingMode); + } } private void InitRefs()