Example #1
0
        public override void OnJoinedRoom()
        {
            base.OnJoinedRoom();
            Debug.LogError("OnJoinedRoom");
            m_autoJoined = true;

            if (m_roomStatus == RoomStatus.PUBLIC)
            {
                Selection.Location       = MeetingRoom;
                Selection.ExperienceType = ExperienceType.MEETING;
                if (PhotonNetwork.IsMasterClient)
                {
                    m_experienceMachine.LoadExperience();
                }
            }
            else
            {
                Selection.Location       = PrivateMeetingLocation;
                Selection.ExperienceType = ExperienceType.MEETING;
                if (PhotonNetwork.IsMasterClient)
                {
                    m_experienceMachine.LoadExperience();
                }
            }
        }
Example #2
0
        public virtual void ExecuteMenuCommand(MenuClickArgs args)
        {
            //Debug.Log(args.Name + " " + args.Path + " " + args.Command + " " + args.CommandType.ToString());
            if (args.CommandType == MenuCommandType.SAVE_PRESET)
            {
                m_experienceMachine.GetExperience(ExperienceType.MANDALA).ExecuteMenuCommand(args);
                return;
            }

            if (args.CommandType == MenuCommandType.QUIT)
            {
                #if UNITY_EDITOR
                UnityEditor.EditorApplication.ExecuteMenuItem("Edit/Play");
                #else
                Application.Quit();
                #endif
                return;
            }

            if (args.CommandType == MenuCommandType.HOME)
            {
                Selection.Location       = args.Path;
                Selection.ExperienceType = ExperienceType.HOME;
                ToggleMenu();
                m_experienceMachine.LoadExperience();
            }

            if (args.CommandType == MenuCommandType.LOBBY)
            {
                if (PhotonNetwork.InRoom)
                {
                    m_network.LeaveRoom();
                }
                else
                {
                    //Selection.Location = args.Path;
                    //Selection.ExperienceType = ExperienceType.LOBBY;
                    //m_uiEngine.Close();
                    //m_experienceMachine.LoadExperience();
                }
            }

            if (args.CommandType == MenuCommandType.SETTINGS)
            {
                m_uiEngine.OpenSettingsInterface(m_commonResource.GetGuideClip(MenuCommandType.SETTINGS));
            }
            if (args.CommandType == MenuCommandType.INVENTORY)
            {
                var resourceType = ResourceType.OBJECT;
                var categories   = m_commonResource.GetCategories(ResourceType.OBJECT);

                if (categories.Length == 0 || (categories.Length == 1 && string.IsNullOrEmpty(categories[0].Name)))
                {
                    throw new NotImplementedException();
                }
                else
                {
                    MenuItemInfo[] categoryItems = GetCategoryMenu(categories, resourceType);

                    m_uiEngine.OpenGridMenu(new GridArgs()
                    {
                        AudioClip = m_commonResource.GetGuideClip(GetCommandType(resourceType)),
                        Items     = categoryItems,
                        Title     = "WHAT KIND OF ITEM WOULD YOU LIKE TO LOAD?",
                    });
                }
            }

            if (args.CommandType == MenuCommandType.MUSIC)
            {
                var categories = GetCategories(ResourceType.MUSIC);
                if (categories.Length == 0 || (categories.Length == 1 && string.IsNullOrEmpty(categories[0].Name)))
                {
                    m_uiEngine.OpenGridMenu(new GridArgs()
                    {
                        AudioClip = m_commonResource.GetGuideClip(MenuCommandType.MUSIC),
                        Items     = ResourceToMenuItems(GetResource(ResourceType.MUSIC, "")),
                        Title     = "SELECT MUSIC",
                    });
                }
                else
                {
                    m_uiEngine.OpenGridMenu(new GridArgs()
                    {
                        AudioClip = m_commonResource.GetGuideClip(MenuCommandType.MUSIC),
                        Items     = GetCategoryMenu(categories, ResourceType.MUSIC),
                        Title     = "WHAT MUSIC IS THE RIGHT FIT?",
                    });
                }
            }
            else if (args.CommandType == MenuCommandType.SELECTION)
            {
                ExecuteSelectionCommand(args);
            }
        }