feat: 完善 Screen System 屏幕面板系统功能
Made-with: Cursor
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user