mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +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;
|
||||
|
||||
_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);
|
||||
if (!_choicePopupPrefab)
|
||||
{
|
||||
_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();
|
||||
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
||||
|
Loading…
Reference in New Issue
Block a user