Merge branch 'bugfix/local' into 'develop'
Bugfix/local See merge request aibis-dream/aibis-dream!397
This commit is contained in:
Binary file not shown.
+797
-685
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Localization;
|
||||
using UnityEngine.Localization.SmartFormat.PersistentVariables;
|
||||
|
||||
[Serializable]
|
||||
public class PunchTape : Clue
|
||||
|
||||
@@ -18,7 +18,6 @@ namespace AibisDream.Framework
|
||||
|
||||
static LocalizationKit()
|
||||
{
|
||||
Debug.Log("初始化");
|
||||
#if UNITY_EDITOR
|
||||
EditorApplication.playModeStateChanged += OnPlayModeChanged;
|
||||
#else
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace AibisDream
|
||||
public class EndPanel : MonoBehaviour, IUIPanel
|
||||
{
|
||||
public bool IsOpen => gameObject.activeSelf;
|
||||
public bool IsCloseable => false;
|
||||
|
||||
#region 打开和关闭
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace AibisDream
|
||||
public class MainPanel : MonoBehaviour, IUIPanel
|
||||
{
|
||||
public bool IsOpen => gameObject.activeSelf;
|
||||
public bool IsCloseable => false;
|
||||
|
||||
#region 面板控制
|
||||
|
||||
@@ -25,6 +26,16 @@ namespace AibisDream
|
||||
{
|
||||
RegisterButton();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKey(KeyCode.Q) && Input.GetKeyDown(KeyCode.P))
|
||||
{
|
||||
var obj = transform.Find("Top Bar").Find("Quick Forward").gameObject;
|
||||
var active = obj.activeSelf;
|
||||
obj.SetActive(!active);
|
||||
}
|
||||
}
|
||||
|
||||
private void RegisterButton()
|
||||
{
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace AibisDream
|
||||
public class PlayToolPanel : MonoBehaviour, IUIPanel
|
||||
{
|
||||
public bool IsOpen => gameObject.activeSelf;
|
||||
public bool IsCloseable => false;
|
||||
|
||||
[Header("Obj尺寸参数")] public float objWidth;
|
||||
public float objHeight;
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace AibisDream
|
||||
public class RecordPanel : MonoBehaviour, IUIPanel
|
||||
{
|
||||
public bool IsOpen => gameObject.activeSelf;
|
||||
public bool IsCloseable => true;
|
||||
|
||||
public readonly StringBuilder recordStr = new();
|
||||
|
||||
@@ -17,7 +18,7 @@ namespace AibisDream
|
||||
GameManager.Instance.PauseGame();
|
||||
gameObject.SetActive(true);
|
||||
|
||||
var btn = transform.Find("Title").Find("Return").GetComponent<Button>();
|
||||
var btn = transform.Find("Return").GetComponent<Button>();
|
||||
btn.onClick.AddListener(ReturnGame);
|
||||
}
|
||||
|
||||
@@ -27,7 +28,7 @@ namespace AibisDream
|
||||
GameManager.Instance.ContinueGame();
|
||||
// 关闭时停止渲染
|
||||
ClearText();
|
||||
var btn = transform.Find("Title").Find("Return").GetComponent<Button>();
|
||||
var btn = transform.Find("Return").GetComponent<Button>();
|
||||
btn.onClick.RemoveAllListeners();
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace AibisDream
|
||||
public class SavesPanel : MonoBehaviour, IUIPanel
|
||||
{
|
||||
public bool IsOpen => gameObject.activeSelf;
|
||||
public bool IsCloseable => true;
|
||||
|
||||
private static readonly string SaveFilePath = Application.streamingAssetsPath + "/SaveFiles";
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace AibisDream
|
||||
public class SettingPanel : MonoBehaviour, IUIPanel
|
||||
{
|
||||
public bool IsOpen => gameObject.activeSelf;
|
||||
public bool IsCloseable => true;
|
||||
|
||||
#region 打开和关闭
|
||||
|
||||
@@ -62,7 +63,6 @@ namespace AibisDream
|
||||
{
|
||||
// 关闭Setting面板
|
||||
UIManager.Instance.HidePanel<SettingPanel>();
|
||||
// TODO 解除暂停
|
||||
}
|
||||
|
||||
private void BackToMain()
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace AibisDream
|
||||
public class StartPanel : MonoBehaviour, IUIPanel
|
||||
{
|
||||
public bool IsOpen => gameObject.activeSelf;
|
||||
public bool IsCloseable => false;
|
||||
|
||||
#region 开启和关闭
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ namespace AibisDream
|
||||
#region 打开和关闭
|
||||
|
||||
public bool IsOpen { get; private set;}
|
||||
public bool IsCloseable => false;
|
||||
|
||||
public void Show()
|
||||
{
|
||||
|
||||
@@ -10,6 +10,7 @@ namespace AibisDream
|
||||
#region 索引
|
||||
|
||||
private Dictionary<Type, IUIPanel> _panelPool;
|
||||
private readonly Stack<IUIPanel> _panelStack = new();
|
||||
|
||||
public RectTransform Canvas { get; private set; }
|
||||
public Vector2 Resolution { get; set; }
|
||||
@@ -21,6 +22,22 @@ namespace AibisDream
|
||||
InitRefs();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.Escape))
|
||||
{
|
||||
if (_panelStack.Count > 0)
|
||||
{
|
||||
var lastPanel = _panelStack.Peek();
|
||||
HidePanel(lastPanel);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowPanel<SettingPanel>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitRefs()
|
||||
{
|
||||
// 获取Canvas
|
||||
@@ -70,6 +87,7 @@ namespace AibisDream
|
||||
if (_panelPool.TryGetValue(type, out var panel))
|
||||
{
|
||||
if (panel.IsOpen) return;
|
||||
if (panel.IsCloseable) _panelStack.Push(panel);
|
||||
panel.Show();
|
||||
call?.Invoke(panel as T);
|
||||
}
|
||||
@@ -86,6 +104,7 @@ namespace AibisDream
|
||||
if (_panelPool.TryGetValue(type, out var panel))
|
||||
{
|
||||
if (!panel.IsOpen) return;
|
||||
if (panel.IsCloseable) _panelStack.Pop();
|
||||
panel.Hide();
|
||||
}
|
||||
else
|
||||
@@ -94,6 +113,20 @@ namespace AibisDream
|
||||
}
|
||||
}
|
||||
|
||||
private void HidePanel<T>(T panel) where T : IUIPanel
|
||||
{
|
||||
if (_panelPool.ContainsValue(panel))
|
||||
{
|
||||
if (!panel.IsOpen) return;
|
||||
if (panel.IsCloseable) _panelStack.Pop();
|
||||
panel.Hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log($"panel {typeof(T)} 未注册");
|
||||
}
|
||||
}
|
||||
|
||||
public T GetPanel<T>() where T : class, IUIPanel
|
||||
{
|
||||
if (_panelPool.TryGetValue(typeof(T), out var panel))
|
||||
|
||||
@@ -7,5 +7,6 @@ namespace AibisDream
|
||||
public virtual void Show() { }
|
||||
public virtual void Hide() { }
|
||||
public bool IsOpen { get; }
|
||||
public bool IsCloseable { get; }
|
||||
}
|
||||
}
|
||||
@@ -133,7 +133,7 @@ PlayerSettings:
|
||||
vulkanEnableLateAcquireNextImage: 0
|
||||
vulkanEnableCommandBufferRecycling: 1
|
||||
loadStoreDebugModeEnabled: 0
|
||||
bundleVersion: 0.2.2.17-20250519-200923
|
||||
bundleVersion: 0.2.2.19-20250519-223248
|
||||
preloadedAssets:
|
||||
- {fileID: 11400000, guid: 0fb2bc2476953fc43a74f0ab8879077c, type: 2}
|
||||
metroInputSource: 0
|
||||
|
||||
Reference in New Issue
Block a user