feat(): 完成将Manager从Gameplay转移到Core,实现循环次数持久化,实现设置面板

This commit is contained in:
2025-10-26 09:32:28 +08:00
parent c1f7418ffa
commit 95616f8c10
20 changed files with 6630 additions and 5767 deletions

View File

@@ -0,0 +1,48 @@
using System;
using Core;
using Script.Gameplay.Global;
using TMPro;
using UnityEngine;
using Script.Gameplay.Input;
namespace UI
{
public class SettingViewer : UIBase
{
[SerializeField] private TMP_Text TitleText;
[SerializeField] private TMP_Text ContentText;
private InputManager inputManager;
protected override void Awake()
{
base.Awake();
inputManager = InputManager.Instance;
inputManager.Input.Player.Setting.performed+= ctx =>
{
if (!isActiveAndEnabled)
{
Show();
inputManager.SetInputForLook(false);
inputManager.SetInputForMove(false);
}
else
{
Hide();
inputManager.SetInputForLook(true);
inputManager.SetInputForMove(true);
}
};
}
public override void Show()
{
base.Show();
ContentText.text = "循环次数:" + GameDataManager.Instance.TotalLoopCount.ToString();
}
public override void Hide()
{
base.Hide();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 4eeaf53256494a5a938c5a3497039772
timeCreated: 1761363001

View File

@@ -1,5 +1,7 @@
using UnityEngine;
using Core;
using Script.Gameplay.Input;
namespace UI
{
public class StartGameButton : UIBase
@@ -8,6 +10,7 @@ namespace UI
public void StartGame()
{
ScenesManager.Instance.LoadGameplay(levelName);
InputManager.Instance.SetCursorState(false,CursorLockMode.Locked);
}
}
}