mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-27 06:20:17 +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;
|
[SerializeField] private bool m_destroyOnClose = false;
|
||||||
public bool DestroyOnClose { get { return m_destroyOnClose; } set { m_destroyOnClose = value; } }
|
public bool DestroyOnClose { get { return m_destroyOnClose; } set { m_destroyOnClose = value; } }
|
||||||
|
|
||||||
|
@ -139,14 +154,14 @@ namespace SanAndreasUnity.UI {
|
||||||
this.WindowStart ();
|
this.WindowStart ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Behaviours.Loader.IsLoading)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!this.IsOpened)
|
if (!this.ShouldBeDrawn)
|
||||||
|
{
|
||||||
|
this.useGUILayout = false;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!Behaviours.GameManager.IsInStartupScene && !PauseMenu.IsOpened)
|
this.useGUILayout = true;
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
Rect newRect;
|
Rect newRect;
|
||||||
|
|
Loading…
Reference in a new issue