mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 12:33:02 +00:00
skip gui layout phase when window is not drawn
This commit is contained in:
parent
617185f8ea
commit
2eabea6626
1 changed files with 23 additions and 8 deletions
|
@ -32,6 +32,21 @@ namespace SanAndreasUnity.UI {
|
|||
}
|
||||
}
|
||||
|
||||
private bool ShouldBeDrawn {
|
||||
get {
|
||||
if (Behaviours.Loader.IsLoading)
|
||||
return false;
|
||||
|
||||
if (!this.IsOpened)
|
||||
return false;
|
||||
|
||||
if (!PauseMenu.IsOpened && !Behaviours.GameManager.IsInStartupScene)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[SerializeField] private bool m_destroyOnClose = false;
|
||||
public bool DestroyOnClose { get { return m_destroyOnClose; } set { m_destroyOnClose = value; } }
|
||||
|
||||
|
@ -139,15 +154,15 @@ namespace SanAndreasUnity.UI {
|
|||
this.WindowStart ();
|
||||
}
|
||||
|
||||
if (Behaviours.Loader.IsLoading)
|
||||
return;
|
||||
|
||||
if (!this.IsOpened)
|
||||
return;
|
||||
|
||||
if (!Behaviours.GameManager.IsInStartupScene && !PauseMenu.IsOpened)
|
||||
return;
|
||||
|
||||
if (!this.ShouldBeDrawn)
|
||||
{
|
||||
this.useGUILayout = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this.useGUILayout = true;
|
||||
|
||||
|
||||
Rect newRect;
|
||||
Rect inputRect = this.windowRect;
|
||||
|
|
Loading…
Reference in a new issue