예제 #1
0
        protected void CreateUI()
        {
            try
            {
                _mainMenuViewController = Resources.FindObjectsOfTypeAll <MainMenuViewController>().First();
                _mainMenuRectTransform  = _mainMenuViewController.transform as RectTransform;

                _mockPartyViewController = new MockPartyViewController();

                if (Config.Instance.AutoStartLobby)
                {
                    SteamAPI.CreateLobby(!Config.Instance.IsPublic);
                }

                AvatarController.LoadAvatars();
                SongListUtils.Initialize();
                MultiplayerListing.Init();
                MultiplayerLobby.Init();
                WaitingMenu.Init();
                CreateMainMenuButton();
                CreateSettingsMenu();
            }
            catch (Exception e)
            {
                Logger.Error($"Unable to create UI! Exception: {e}");
            }
        }
예제 #2
0
        protected void CreateUI()
        {
            try
            {
                _mainMenuViewController = Resources.FindObjectsOfTypeAll <MainMenuViewController>().First();
                _mainMenuViewController.didFinishEvent += (sender, result) =>
                {
                    Logger.Debug($"finish \"{result}\"");
                    if (result == MainMenuViewController.MenuButton.Party)
                    {
                        try
                        {
                            _mockPartyViewController = new MockPartyViewController();
                        } catch (Exception e)
                        {
                            Logger.Error(e);
                        }
                    }
                };
                _mainMenuRectTransform = _mainMenuViewController.transform as RectTransform;

                if (Config.Instance.AutoStartLobby)
                {
                    SteamAPI.CreateLobby(!Config.Instance.IsPublic);
                }
                try
                {
                    AvatarController.LoadAvatars();
                } catch (Exception e)
                {
                    Logger.Error($"Unable to load avatars! Exception: {e}");
                }
                SongListUtils.Initialize();
                MultiplayerListing.Init();
                MultiplayerLobby.Init();
                WaitingMenu.Init();
                CreateSettingsMenu();
                CreateMainMenuButton();
            }
            catch (Exception e)
            {
                Logger.Error($"Unable to create UI! Exception: {e}");
            }
        }