71 lines
1.9 KiB
C#
71 lines
1.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using AibisDream.Framework;
|
|
using AibisDream.Kit;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream.FixSystem
|
|
{
|
|
/// <summary>
|
|
/// 维修面板系统 - 统一管理所有侧边栏面板
|
|
/// 包括常驻面板(对话、任务)和随状态切换的游戏面板
|
|
/// </summary>
|
|
public class FixPanelSystem : Singleton<FixPanelSystem>
|
|
{
|
|
private void OnEnable()
|
|
{
|
|
RegisterScreenView();
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
UnRegisterScreenView();
|
|
}
|
|
|
|
#region 维修面板
|
|
|
|
private static IOCContainer _repairPanelContainer = new();
|
|
|
|
public static void RegisterRepairPanel<T>(T panel)
|
|
{
|
|
_repairPanelContainer.Register(panel);
|
|
}
|
|
|
|
public static T GetRepairPanel<T>() where T : class
|
|
{
|
|
return _repairPanelContainer.Get<T>();
|
|
}
|
|
|
|
public static void UnregisterRepairPanel<T>() where T : class
|
|
{
|
|
_repairPanelContainer.Unregister<T>();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 常驻面板
|
|
|
|
[Header("任务面板")]
|
|
[SerializeField] private TaskPanel taskPanel;
|
|
public TaskPanel TaskPanel => taskPanel;
|
|
|
|
[Header("屏幕面板")]
|
|
[SerializeField] private ScreenPanel screenPanel;
|
|
public ScreenPanel ScreenPanel => screenPanel;
|
|
|
|
private void RegisterScreenView()
|
|
{
|
|
// DialogUIManager.Instance.RegisterScreenView(DialogViewType.Screen, screenPanel);
|
|
// DialogUIManager.Instance.RegisterScreenView(DialogViewType.Task, taskPanel);
|
|
}
|
|
|
|
private void UnRegisterScreenView()
|
|
{
|
|
// DialogUIManager.Instance.UnRegisterScreenView(DialogViewType.Screen);
|
|
// DialogUIManager.Instance.UnRegisterScreenView(DialogViewType.Task);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|