feat: 完善 Screen System 屏幕面板系统功能

Made-with: Cursor
This commit is contained in:
2026-03-03 21:45:21 +08:00
parent fa0672445b
commit d89bba279b
5 changed files with 38 additions and 28 deletions
@@ -1,6 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using AibisDream.Framework;
using AibisDream.Framework;
using AibisDream.Kit;
using UnityEngine;
@@ -14,36 +12,41 @@ namespace AibisDream.FixSystem
{
private void OnEnable()
{
RegisterPanels();
RegisterScreenView();
}
private void OnDisable()
{
_panelContainer.Clear();
UnRegisterScreenView();
}
#region
private static IOCContainer _repairPanelContainer = new();
public static void RegisterRepairPanel<T>(T panel)
{
_repairPanelContainer.Register(panel);
}
private static IOCContainer _panelContainer = new();
public static T GetRepairPanel<T>() where T : class
{
return _repairPanelContainer.Get<T>();
return _panelContainer.Get<T>();
}
public static void UnregisterRepairPanel<T>() where T : class
public void RegisterPanels()
{
_repairPanelContainer.Unregister<T>();
var panels = GetComponentsInChildren<IOperatorPanel>(true);
foreach (var panel in panels)
{
_panelContainer.RegisterByInstance(panel);
}
}
#endregion
#region
#region
[Header("默认气泡")]
[SerializeField] private BubbleSlotGroup bubbleSlotGroup;
public BubbleSlotGroup BubbleSlotGroup => bubbleSlotGroup;
[Header("任务面板")]
[SerializeField] private TaskPanel taskPanel;
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using AibisDream.UI;
using UnityEngine.UI;
using System;
@@ -6,7 +6,7 @@ using UnityEngine.Events;
namespace AibisDream.FixSystem
{
public class BlockPuzzlePart : MonoBehaviour, IOperatorPanel
public class BlockPuzzlePanel : MonoBehaviour, IOperatorPanel
{
public UnityEvent OnSubmit => lockButton.onClick;
public UnityEvent OnPopUp => popUpButton.onClick;
@@ -1,5 +1,6 @@
using UnityEngine;
using AibisDream.UI;
using AibisDream.Framework;
using System.Globalization;
using TMPro;
@@ -10,6 +11,16 @@ namespace AibisDream.FixSystem
[SerializeField] private TMP_Text title;
[SerializeField] private TerminalText logText;
private void OnEnable()
{
EnumEventSystem.Global.Register(EventEnum.PlugOut, ClearScreen);
}
private void OnDisable()
{
EnumEventSystem.Global.UnRegister(EventEnum.PlugOut, ClearScreen);
}
// ---------------------- 对话框功能 ----------------------
public void RunLine(LineSyncToken token)
{
@@ -1,9 +1,8 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using AibisDream.Framework;
using AibisDream.Utility;
using DG.Tweening;
using Febucci.UI;
using Febucci.UI.Core;
using TMPro;
@@ -86,11 +85,6 @@ namespace AibisDream.FixSystem
ShowTitle(string.Empty);
}
public void ShowTaskPanel()
{
TaskScreen.transform.DOLocalMoveX(-7.12f, 1f);
}
#endregion
public void RunLine(LineSyncToken token)
@@ -6,33 +6,35 @@ namespace AibisDream
{
public static class ScreenYarnCommand
{
private static ScreenSystem ScreenSystem => FixSystemCenter.SystemDic.Get<ScreenSystem>();
private static FixLightSystem LightSystem => ScreenSystem?.FixLightSystem;
private static FixLightSystem LightSystem => FixPanelSystem.GetRepairPanel<CablePanel>().FixLightSystem;
private static TaskPanel TaskPanel => FixPanelSystem.Instance.TaskPanel;
private static ScreenPanel ScreenPanel => FixPanelSystem.Instance.ScreenPanel;
#region Screen相关命令
[YarnCommand("clear_screen")]
public static void ClearTextScreen()
{
ScreenSystem.ClearTextScreen();
ScreenPanel.ClearScreen();
}
[YarnCommand("complete_task")]
public static void CompleteTask(string lineId)
{
ScreenSystem.TaskScreen.CompleteTask(lineId);
TaskPanel.CompleteTask(lineId);
}
[YarnCommand("clear_tasks")]
public static void ClearTasks()
{
ScreenSystem.TaskScreen.ClearTasks();
TaskPanel.ClearTasks();
}
[YarnCommand("show_task_panel")]
public static void ShowTaskPanel()
{
ScreenSystem.ShowTaskPanel();
TaskPanel.ShowPanel();
}
#endregion