(client) feat:实现热重载,实现多维度,实现武器,实现掉落物,实现状态UI,实现攻击AI (#44)
Co-authored-by: zzdxxz <2079238449@qq.com> Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
@ -105,7 +105,7 @@ namespace Base
|
||||
// 如果窗口是独占的,隐藏所有其他窗口
|
||||
if (windowToShow.exclusive)
|
||||
{
|
||||
List<UIBase> windowsToHide = new List<UIBase>(_visibleWindows);
|
||||
var windowsToHide = new List<UIBase>(_visibleWindows);
|
||||
foreach (var visibleWindow in windowsToHide)
|
||||
{
|
||||
Hide(visibleWindow);
|
||||
@ -121,6 +121,21 @@ namespace Base
|
||||
needUpdate = true;
|
||||
}
|
||||
|
||||
public void Show(string uiName)
|
||||
{
|
||||
foreach (var window in _allWindows)
|
||||
{
|
||||
if (window.name == uiName)
|
||||
{
|
||||
Show(window);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Debug.LogWarning($"未找到窗口{uiName}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 公开的隐藏窗口方法
|
||||
/// </summary>
|
||||
@ -133,13 +148,31 @@ namespace Base
|
||||
windowToHide.Hide();
|
||||
needUpdate = true;
|
||||
}
|
||||
public void Hide(string uiName)
|
||||
{
|
||||
foreach (var visibleWindow in _visibleWindows)
|
||||
{
|
||||
if (visibleWindow.name == uiName)
|
||||
{
|
||||
Hide(visibleWindow);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HideAll()
|
||||
{
|
||||
foreach (var visibleWindow in _visibleWindows)
|
||||
{
|
||||
Hide(visibleWindow);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据当前所有可见窗口的 needPause 属性来更新游戏时钟的暂停状态
|
||||
/// </summary>
|
||||
private void UpdatePauseState()
|
||||
{
|
||||
bool shouldPause = _visibleWindows.Any(w => w.needPause);
|
||||
var shouldPause = _visibleWindows.Any(w => w.needPause);
|
||||
if (Base.Clock.Instance.Pause != shouldPause)
|
||||
{
|
||||
Base.Clock.Instance.Pause = shouldPause;
|
||||
@ -170,7 +203,7 @@ namespace Base
|
||||
{
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
|
||||
// RegisterAllWindows();
|
||||
RegisterAllWindows();
|
||||
}
|
||||
|
||||
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
||||
|
Reference in New Issue
Block a user