diff --git a/Assets/Scripts/Game Loop/DemoTimer.cs b/Assets/Scripts/Game Loop/DemoTimer.cs deleted file mode 100644 index 088d38195..000000000 --- a/Assets/Scripts/Game Loop/DemoTimer.cs +++ /dev/null @@ -1,74 +0,0 @@ -using AibisDream.Framework; -using AibisDream.UI; -using UnityEngine; -using TMPro; - -namespace AibisDream -{ - public class DemoTimer : MonoBehaviour - { - public float totalTimeInSeconds = 1200f; - private TMP_Text _timerText; - private float _currentTime; - private bool _isRunning; - - private void Awake() - { - _timerText = GetComponent(); - // 注册事件 - EnumEventSystem.Global.Register(GameLifecycleEvent.SessionStarted, TimerStart); - EnumEventSystem.Global.Register(GameLifecycleEvent.SessionEnded, TimerStop); - } - - private void TimerStart() - { - _currentTime = totalTimeInSeconds; - _isRunning = true; - _timerText.enabled = true; - } - - private void TimerStop() - { - _currentTime = 0; - _isRunning = false; - _timerText.enabled = false; - } - - private void TimerPause() - { - _isRunning = false; - } - - private void Update() - { - if (_isRunning) - { - _currentTime -= Time.deltaTime; - if (_currentTime <= 0) - { - TimerPause(); - ForceReturnToMainMenu(); - } - else - { - UpdateTimerDisplay(); - } - } - } - - private void UpdateTimerDisplay() - { - int hours = Mathf.FloorToInt(_currentTime / 3600); - int minutes = Mathf.FloorToInt(_currentTime % 3600 / 60); - int seconds = Mathf.FloorToInt(_currentTime % 60); - - _timerText.text = $"{hours:D2}:{minutes:D2}:{seconds:D2}"; - } - - private void ForceReturnToMainMenu() - { - // 打开EndPanel - UIManager.Instance.ShowPanel(); - } - } -} diff --git a/Assets/Scripts/Game Loop/DemoTimer.cs.meta b/Assets/Scripts/Game Loop/DemoTimer.cs.meta deleted file mode 100644 index 94a2ad65d..000000000 --- a/Assets/Scripts/Game Loop/DemoTimer.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: a21f67dffcd841adb0f408b5cf075ea8 -timeCreated: 1750061640 \ No newline at end of file diff --git a/Assets/Scripts/Game Loop/SettingLoader.cs b/Assets/Scripts/Game Loop/SettingLoader.cs index fbe144f44..500646c60 100644 --- a/Assets/Scripts/Game Loop/SettingLoader.cs +++ b/Assets/Scripts/Game Loop/SettingLoader.cs @@ -2,7 +2,6 @@ using System.Globalization; using AibisDream.Framework; using AibisDream.Kit; -using AibisDream.UI; using UnityEngine; using System.IO; using AibisDream.Utility; @@ -85,14 +84,6 @@ namespace AibisDream case "Language": LocalizationKit.SwitchLanguage(LocalizationKit.ResolveLanguage(value)); break; - case "OpenTimer": - var isTimerOpen = bool.TryParse(value, out var result) ? result : false; - UIManager.Instance.GetPanel().SetTimerActive(isTimerOpen); - break; - case "EndTime": - int endTime = int.TryParse(value, NumberStyles.None, CultureInfo.InvariantCulture, out var endTime1) ? endTime1 : 1200; - UIManager.Instance.GetPanel().SetTimerDuration(endTime); - break; default: Debug.Log($"{propName}未正确处理"); break; diff --git a/Assets/Scripts/UI/Panel/InfoPanel.cs b/Assets/Scripts/UI/Panel/InfoPanel.cs index f747e22d3..1e61b243d 100644 --- a/Assets/Scripts/UI/Panel/InfoPanel.cs +++ b/Assets/Scripts/UI/Panel/InfoPanel.cs @@ -1,23 +1,12 @@ -using UnityEngine; +using UnityEngine; namespace AibisDream.UI { public class InfoPanel : MonoBehaviour, IUIPanel { - [SerializeField] private DemoTimer demoTimer; [SerializeField] private GameObject loading; [SerializeField] private GameObject saveLoading; - public void SetTimerActive(bool isOpen) - { - demoTimer.gameObject.SetActive(isOpen); - } - - public void SetTimerDuration(int time) - { - demoTimer.totalTimeInSeconds = time; - } - public void Show() { gameObject.SetActive(true); diff --git a/Assets/StreamingAssets/Config/setting.json b/Assets/StreamingAssets/Config/setting.json index 60298a101..fc1948374 100644 --- a/Assets/StreamingAssets/Config/setting.json +++ b/Assets/StreamingAssets/Config/setting.json @@ -2,7 +2,5 @@ "Volume": "0.20", "Language": "", "WindowMode": "FullScreen", - "TextSpeed": "3.0", - "OpenTimer": false, - "EndTime": 1500 -} \ No newline at end of file + "TextSpeed": "3.0" +}