fix(UI): 修复当UIBase的IsOpenOnFirstLoad为false的时候,会导致组件的Awake无法触发的BUG
This commit is contained in:
@@ -10,6 +10,12 @@ namespace Core
|
||||
public abstract class UIBase : MonoBehaviour
|
||||
{
|
||||
public bool IsOpenOnFirstLoad;
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
if (!IsOpenOnFirstLoad) Hide();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the UI is shown.
|
||||
/// </summary>
|
||||
|
@@ -48,11 +48,6 @@ namespace Core
|
||||
if (uiBase != null && !openedUIs.ContainsKey(uiName))
|
||||
{
|
||||
openedUIs[uiName] = uiBase;
|
||||
uiBase.Hide(); // 默认关闭
|
||||
if (uiBase.IsOpenOnFirstLoad)
|
||||
{
|
||||
uiBase.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user