mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 09:32:38 +00:00
dont create popup prefab if it already exists
This commit is contained in:
parent
cbd02995d9
commit
9e2a6777af
@ -54,9 +54,12 @@ internal class MenuManager : MonoBehaviour, IAddComponentOnStart
|
|||||||
{
|
{
|
||||||
Instance = this;
|
Instance = this;
|
||||||
|
|
||||||
_choicePopupPrefab = Instantiate(Resources.FindObjectsOfTypeAll<PopupMenu>().First(x => x.name == "TwoButton-Popup" && x.transform.parent.name == "PopupCanvas" && x.transform.parent.parent.name == "TitleMenu").gameObject);
|
if (!_choicePopupPrefab)
|
||||||
DontDestroyOnLoad(_choicePopupPrefab);
|
{
|
||||||
_choicePopupPrefab.SetActive(false);
|
_choicePopupPrefab = Instantiate(Resources.FindObjectsOfTypeAll<PopupMenu>().First(x => x.name == "TwoButton-Popup" && x.transform.parent.name == "PopupCanvas" && x.transform.parent.parent.name == "TitleMenu").gameObject);
|
||||||
|
DontDestroyOnLoad(_choicePopupPrefab);
|
||||||
|
_choicePopupPrefab.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
MakeTitleMenus();
|
MakeTitleMenus();
|
||||||
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user