// ------------------------------------------- /* * Constructor */ public override void Initialize(params object[] _list) { base.Initialize(_list); m_root = this.gameObject; m_container = m_root.transform.Find("Content"); #if !ALTERNATIVE_TITLE m_container.Find("Title").GetComponent <Text>().text = LanguageController.Instance.GetText("message.game.title"); #else m_container.Find("Title").GetComponent <Text>().text = LanguageController.Instance.GetText("message.game.mobile.title"); #endif GameObject playAsCustomer = m_container.Find("Button_Customer").gameObject; playAsCustomer.transform.Find("Text").GetComponent <Text>().text = LanguageController.Instance.GetText("screen.play.as.customer"); playAsCustomer.GetComponent <Button>().onClick.AddListener(PlayAsCustomer); GameObject playAsDirector = m_container.Find("Button_Director").gameObject; playAsDirector.transform.Find("Text").GetComponent <Text>().text = LanguageController.Instance.GetText("screen.play.as.director"); playAsDirector.GetComponent <Button>().onClick.AddListener(PlayAsDirector); GameObject playAsSpectator = m_container.Find("Button_Spectator").gameObject; if (playAsSpectator != null) { playAsSpectator.transform.Find("Text").GetComponent <Text>().text = LanguageController.Instance.GetText("screen.play.as.spectator"); playAsSpectator.GetComponent <Button>().onClick.AddListener(PlayAsSpectator); } MultiplayerConfiguration.SaveSpectatorMode(MultiplayerConfiguration.SPECTATOR_MODE_DISABLED); UIEventController.Instance.UIEvent += new UIEventHandler(OnMenuEvent); }
// ------------------------------------------- /* * PlayAsSpectator */ private void PlayAsSpectator() { if (MenuScreenController.Instance.EnableAppOrganization) { UIEventController.Instance.DispatchUIEvent(EVENT_SCREENDIRECTORMODE_SELECTED_PROFILE, FunctionsScreenController.PROFILE_PLAYER.SPECTATOR); GoBackPressed(); } else { if (NetworkEventController.Instance.MenuController_LoadNumberOfPlayers() == MultiplayerConfiguration.VALUE_FOR_JOINING) { MultiplayerConfiguration.SaveDirectorMode(MultiplayerConfiguration.DIRECTOR_MODE_ENABLED); MultiplayerConfiguration.SaveSpectatorMode(MultiplayerConfiguration.SPECTATOR_MODE_ENABLED); CardboardLoaderVR.Instance.SaveEnableCardboard(false); MultiplayerConfiguration.SaveGoogleARCore(MultiplayerConfiguration.GOOGLE_ARCORE_DISABLED); MenuScreenController.Instance.LoadGameScene(this); } } }