void Awake() { buttonsToHideWhenPanelIsOpen = GameObjectUtils.FindAllObjectsWithTags <Button>(tagsOfButtonsToHideWhenPanelIsOpen); labelsToHideWhenPanelIsOpen = GameObjectUtils.FindAllObjectsWithTags <TMPro.TextMeshProUGUI>(tagsOfLabelsToHideWhenPanelIsOpen); mainMenuPanelController.SetActionOnStartPressed(() => LoadGame()); mainMenuPanelController.SetActionOnPanelOpen(() => ToggleMenuVisibility(true)); mainMenuPanelController.SetActionOnPanelClose(() => ToggleMenuVisibility(false)); #if UNITY_WEBGL GameObjectUtils.SetButtonActiveAndEnabled(quitButton, false); #endif }
void Awake() { if (!SceneUtils.IsSceneAbleToLoad(sceneName)) { Debug.LogError($"Scene cannot be loaded, perhaps `{sceneName}` is misspelled?"); } mainMenuPanelController.SetActionOnStartPressed(() => LoadGame()); mainMenuPanelController.SetActionOnPanelOpen(() => ToggleMainMenuVisibility(false)); mainMenuPanelController.SetActionOnPanelClose(() => ToggleMainMenuVisibility(true)); #if UNITY_WEBGL UiUtils.SetButtonActiveAndEnabled(quitButton, false); #endif }