public void Init() { if (FindObjectsOfType <HUDController>().Length > 1) { Debug.LogError("Multiple HUD managers found in scene", this); Destroy(this); } EventRelay.OnTurnStarted += this.OnTurnStarted; this.CreatePageControllers(); SFXHelpers.AddButtonBehaviours(this.pageGameplayView.gameObject, null, this.btnClickSfx, null, null); SFXHelpers.AddButtonBehaviours(this.popupGameoverView.gameObject, null, this.btnClickSfx, null, null); SFXHelpers.AddButtonBehaviours(this.pageLoadingView.gameObject, null, this.btnClickSfx, null, null); this.pageLoadingController.OpenAndClose(this.pageGameplayController); }
void Awake() { if (FindObjectsOfType <MainMenuController>().Length > 1) { Debug.LogError("Multiple MainMenuManager managers found in scene", this); Destroy(this); } this.pageMainMenuController = new PageMainMenuController( new UIPageModel(PageType.Window), this.pageMainMenuView ); this.pageLoadingController = new PageLoadingController( new PageLoadingModel(PageType.Window), this.pageLoadingView ); SFXHelpers.AddButtonBehaviours(this.pageMainMenuView.gameObject, null, this.btnClickSfx, null, null); SFXHelpers.AddButtonBehaviours(this.pageLoadingView.gameObject, null, this.btnClickSfx, null, null); }