mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
UIWindow同一帧关闭导致GameObject无法销毁的极小概率bug修复
This commit is contained in:
@@ -226,6 +226,7 @@ namespace TEngine
|
||||
/// </summary>
|
||||
internal bool IsLoadDone = false;
|
||||
|
||||
internal bool IsDestroyed = false;
|
||||
#endregion
|
||||
|
||||
public void Init(string name, int layer, bool fullScreen, string assetName, bool fromResources, int hideTimeToClose)
|
||||
@@ -395,6 +396,8 @@ namespace TEngine
|
||||
_panel = null;
|
||||
}
|
||||
|
||||
IsDestroyed = true;
|
||||
|
||||
if (!isShutDown)
|
||||
{
|
||||
CancelHideToCloseTimer();
|
||||
@@ -414,6 +417,12 @@ namespace TEngine
|
||||
|
||||
IsLoadDone = true;
|
||||
|
||||
if (IsDestroyed)
|
||||
{
|
||||
Object.Destroy(panel);
|
||||
return;
|
||||
}
|
||||
|
||||
panel.name = GetType().Name;
|
||||
_panel = panel;
|
||||
_panel.transform.localPosition = Vector3.zero;
|
||||
|
Reference in New Issue
Block a user