예제 #1
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.RoomBrowserUI,
                UIframework.UIManager.DisplayUIMode.Normal,
                UIframework.UIManager.UITypes.UnderBlurEffect,
                false, true);

            // Keep track the room count everytime the room list update.
            m_LastUpdateRoomCount = 0;

            m_RoomList    = GetComponentInChildren <RoomList>();
            m_RoomPreview = GetComponentInChildren <RoomPreview>();
            m_NoRoomAvailablePopupWindow = GetComponentInChildren <PupupWindowUI>();
            m_Animator = GetComponent <Animator>();


#if UNITY_EDITOR
            if (m_RoomList == null)
            {
                Debug.LogError("Couldn't find room list compoment under " + this.gameObject.name);
            }
            if (m_RoomPreview == null)
            {
                Debug.LogError("Couldn't find room preview compoment under " + this.gameObject.name);
            }
            if (m_NoRoomAvailablePopupWindow == null)
            {
                Debug.LogError("Couldn't find PopupWindow UI compoment under " + this.gameObject.name);
            }
#endif
            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #2
0
        public override void InitUI()
        {
            base.InitUI();


            m_AllInited     = false;
            m_StopUIProcess = false;

            if (!NetworkManager.IsConnectedToServer)
            {
                return;
            }


            Instance   = this;
            Properties = new UIProperties(UIframework.UIManager.SceneUIs.GameRoomUI, UIframework.UIManager.DisplayUIMode.NeverHide, UIframework.UIManager.UITypes.UnderBlurEffect, false, true);

            leaderBoard = GetComponentInChildren <LeaderBoardUI>();
            // leaderBoard.Init(GameRoomManager.CurrentGameMode.IsUsingTeamRule());

            //GameOpeningUI = GetComponentInChildren<GameOpening>();
            //GameOpeningUI.Init(RoomManager.CurrentGameMode.IsUsingTeamRule());


            PlayerHUDUI = GetComponentInChildren <PlayerHUD>();
            PlayerHUDUI.Init();

            MessageCenterUI = GetComponentInChildren <MessageCenter>();
            MessageCenterUI.Init();

            m_AllInited = true;
        }
예제 #3
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.LobbyNavigationBarUI,
                UIframework.UIManager.DisplayUIMode.NeverHide,
                UIframework.UIManager.UITypes.UnderBlurEffect,
                false, true, false);
        }
예제 #4
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIManager.SceneUIs.RespawnCountDownUI,
                UIManager.DisplayUIMode.Normal,
                UIManager.UITypes.AboveBlurEffect,
                false, true);

            m_RespawnTimer = 0.0f;
            m_Animator     = GetComponent <Animator>();

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #5
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.ExitGameDialogUI,
                UIframework.UIManager.DisplayUIMode.Dialog,
                UIframework.UIManager.UITypes.AboveBlurEffect,
                false, true, true);

            // Exit game dialog don't need a header.
            m_DialogHeader.text = "";

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #6
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.GameMenuUI,
                UIframework.UIManager.DisplayUIMode.HideOthers,
                UIframework.UIManager.UITypes.AboveBlurEffect,
                false, true, true);

            m_Animator = GetComponent <Animator>();

#if UNITY_EDITOR
            if (!m_ExitRoomButton)
            {
                Debug.LogError("m_ExitRoomButton is null");
            }
            if (!m_ExitRoomButtonText)
            {
                Debug.LogError("m_ExitRoomButtonText is null");
            }
            if (!m_AboutButton)
            {
                Debug.LogError("m_AboutButton is null");
            }
            if (!m_HelpButton)
            {
                Debug.LogError("m_HelpButton is null");
            }
            if (!m_SettingsButton)
            {
                Debug.LogError("m_SettingsButton is null");
            }
            if (!m_ReturnButton)
            {
                Debug.LogError("m_Button is null");
            }
#endif

            m_AboutButton.onClick.AddListener(delegate { OnClickedAbout(); });
            m_HelpButton.onClick.AddListener(delegate { OnClickedHelp(); });
            m_SettingsButton.onClick.AddListener(delegate { OnClickedSettings(); });
            m_ReturnButton.onClick.AddListener(delegate { OnClickedReturn(); });
            m_ExitRoomButton.onClick.AddListener(delegate { OnClickedExitRoom(); });

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #7
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.DamageHUDUI,
                UIframework.UIManager.DisplayUIMode.Normal,
                UIframework.UIManager.UITypes.UnderBlurEffect,
                true, true);

            m_IndicatorList            = new List <DamageIndicator>();
            m_IndicatorDisplayDuration = 4;
            m_PerfabInstanceID         = 0;

            // Create a new pool in the object pooling manager for the indicators.
            ObjectPoolManager.Instance.CreaterPool(IndicatorUIPerfab, IndicatorRoot, 12);
            m_PerfabInstanceID = IndicatorUIPerfab.GetInstanceID();
        }
예제 #8
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.PlayerHUDUI,
                UIframework.UIManager.DisplayUIMode.Normal,
                UIframework.UIManager.UITypes.AboveBlurEffect,
                true, true);

#if UNITY_EDITOR
            if (!m_HealthBar)
            {
                Debug.Log("m_HealthBar is null");
            }
            if (!m_WeaponInfo)
            {
                Debug.Log("m_WeaponInfo is null");
            }
            if (!m_CorssHair)
            {
                Debug.Log("m_CorssHair is null");
            }
            if (!GetTimer)
            {
                Debug.Log("GetTimer is null");
            }
            if (!m_KillComfirmation)
            {
                Debug.Log("m_KillComfirmation is null");
            }
            if (!m_FloatingDamageNumber)
            {
                Debug.Log("m_FloatingDamageNumber is null");
            }
#endif
            // Maybe i should make a base class for these guys...ummm
            m_HealthBar.Init();
            m_WeaponInfo.Init();
            m_CorssHair.Init();
            m_Timer.Init();
            m_KillComfirmation.Init();
            m_FloatingDamageNumber.Init();
        }
예제 #9
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.InGameMessageUI,
                UIframework.UIManager.DisplayUIMode.Normal,
                UIframework.UIManager.UITypes.AboveBlurEffect,
                true, true);

            m_Message = "";
            m_MessageDisplayDuration = 4.0f;

            m_CanvasGroup.alpha          = 0.0f;
            m_CanvasGroup.interactable   = false;
            m_CanvasGroup.blocksRaycasts = false;

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #10
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.GameOpeningUI,
                UIframework.UIManager.DisplayUIMode.Normal,
                UIframework.UIManager.UITypes.AboveBlurEffect,
                false, true);

#if UNITY_EDITOR
            if (!m_RoomAndMapName)
            {
                Debug.Log("m_RoomAndMapName is null.");
            }
            if (!m_RoomDetail)
            {
                Debug.Log("m_RoomDetail is null.");
            }
            if (!m_ObjectiveHeader)
            {
                Debug.Log("m_ObjectiveHeader is null.");
            }
            if (!m_ObjectiveDescription)
            {
                Debug.Log("m_ObjectiveDescription is null.");
            }
            if (!m_StartGameButton)
            {
                Debug.Log("m_StartGameButton is null.");
            }
            if (!m_StartGameButtonText)
            {
                Debug.Log("m_StartGameButtonText is null.");
            }
#endif
            m_Animator = GetComponent <Animator>();
            m_StartGameButton.onClick.AddListener(delegate { OnClickedStartGameButton(); });

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #11
0
        public override void InitUI()
        {
            base.InitUI();
            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.MainMenuUI,
                UIframework.UIManager.DisplayUIMode.NeverHide,
                UIframework.UIManager.UITypes.UnderBlurEffect,
                false, true);

            #if UNITY_EDITOR
            if (!UserNickNameInputField) Debug.LogError("UserNickNameInputField is null");
            if (!LoginButton) Debug.LogError("LoginButton is null");
            if (!UserNickNameInputFieldTip) Debug.LogError("UserNickNameInputFieldTip is null");
            #endif

            UserNickNameInputField.onEndEdit.AddListener(value => OnUserNickNameUpdate(value));

            LoginButton.onClick.AddListener(delegate { OnClickedLoginButton(); });
            LoginButton.interactable = false;

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #12
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.LeaderBoardUI,
                UIframework.UIManager.DisplayUIMode.Normal,
                UIframework.UIManager.UITypes.AboveBlurEffect, true, true);

            // Store all the leaderborad list
            m_lists.Clear();
            foreach (var item in ListRoot.GetComponentsInChildren <LeaderBoradSingleList>())
            {
                item.Init();
                m_lists.Add(item);
            }

            // Get current room information form the server.
            Room currentRoom = PhotonNetwork.room;

            if (RoomProperties.ContantsKey(currentRoom, RoomProperties.MapIndex))
            {
                m_GameMap = GameMapManager.GetGameMap((int)currentRoom.customProperties[RoomProperties.MapIndex]).GameMapName;
            }

            if (RoomProperties.ContantsKey(currentRoom, RoomProperties.GameModeIndex))
            {
                m_GameMode = GameModeManager.GetGameModeDetail(
                    (int)currentRoom.customProperties[RoomProperties.GameModeIndex]).GameModeName.ToUpper();
            }

            if (RoomProperties.ContantsKey(currentRoom, RoomProperties.RoundTimeLimit))
            {
                m_TimeLimit = (int)currentRoom.customProperties[RoomProperties.RoundTimeLimit];
            }

            // Initialize the leader board header and the room info.
            UpdateHeaederText();
        }
예제 #13
0
        /// <summary>
        /// Use this for initialization
        /// </summary>
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.CreateRoomUI,
                UIframework.UIManager.DisplayUIMode.Normal,
                UIframework.UIManager.UITypes.UnderBlurEffect,
                false, true);

            #region Init variables
            // The user inserted room name.
            m_RoomName = "";

            // The user selected game map scene name.
            m_GameMapID = 0;

            // The user selected game mode.
            m_GameModeID = 0;

            // The maximun player count limit.
            m_PlayerLimit = 0;

            // The time limit pre round.
            m_TimeLimit = 0;

            // The health limit for every player pre life.
            m_HealthLimit = 0;
            #endregion

            #region Room name
            if (RoomNameInput)
            {
                RoomNameInput.onValueChanged.AddListener((Value) => SetRoomName(Value));
            }
            #endregion

            #region Map select
            if (MapSelect)
            {
                for (int index = 0; index < GameMapManager.GetMapCount; index++)
                {
                    MapSelect.options.Add(new Dropdown.OptionData()
                    {
                        text = GameMapManager.GetGameMap(index).GameMapName
                    });
                }

                // We need this step to refresh the options list.
                MapSelect.value = 1;
                MapSelect.value = 0;

                // Set default values.
                m_GameMapID = 0;
                SetMapPreview(0);

                // Add event listener to the drop down menu.
                MapSelect.onValueChanged.AddListener((value) => SetGameMap(value));
            }
            #endregion

            #region Player limit setting
            if (PlayerLimit)
            {
                for (int index = 0; index < CustomRoomOptions.AvaliablePlayerLimitOptions.Length; index++)
                {
                    PlayerLimit.options.Add(new Dropdown.OptionData()
                    {
                        text = CustomRoomOptions.AvaliablePlayerLimitOptions[index].ToString() + " 人"
                    });
                }

                // We need this step to refresh the options list.
                PlayerLimit.value = 1;
                PlayerLimit.value = 0;

                // Set default value.
                m_PlayerLimit = CustomRoomOptions.AvaliablePlayerLimitOptions[0];

                // Add event listener to the drop down menu.
                PlayerLimit.onValueChanged.AddListener((value) => SetPlayerLimit(value));
            }
            #endregion

            #region Game mode setting
            if (GameMode)
            {
                for (int index = 0; index < GameModeManager.GetGameModeCount; index++)
                {
                    GameMode.options.Add(new Dropdown.OptionData()
                    {
                        text = GameModeManager.GetGameModeDetail(index).GameModeName
                    });
                }

                // We need this step to refresh the options list.
                GameMode.value = 1;
                GameMode.value = 0;

                // Set default value.
                m_GameModeID = 0;

                // Add event listener to the drop down menu.
                GameMode.onValueChanged.AddListener((value) => SetGameMode(value));
            }
            #endregion

            #region Time limit setting
            if (TimeLimit)
            {
                for (int index = 0; index < CustomRoomOptions.AvaliableTimeLimitOptions.Length; index++)
                {
                    TimeLimit.options.Add(new Dropdown.OptionData()
                    {
                        text = CustomRoomOptions.AvaliableTimeLimitOptions[index].ToString() + " 分"
                    });
                }

                // We need this step to refresh the options list.
                TimeLimit.value = 1;
                TimeLimit.value = 0;

                // Set default value.
                m_TimeLimit = CustomRoomOptions.AvaliableTimeLimitOptions[0];

                // Add event listener to the drop down menu.
                TimeLimit.onValueChanged.AddListener((value) => SetTimeLimit(value));
            }
            #endregion

            #region Health limit setting
            if (HealthLimit)
            {
                for (int index = 0; index < CustomRoomOptions.AvaliableHealthLimitOptions.Length; index++)
                {
                    HealthLimit.options.Add(new Dropdown.OptionData()
                    {
                        text = CustomRoomOptions.AvaliableHealthLimitOptions[index].ToString() + " ポイント"
                    });
                }

                // We need this step to refresh the options list.
                HealthLimit.value = 1;
                HealthLimit.value = 0;

                // Set default value.
                m_HealthLimit = CustomRoomOptions.AvaliableHealthLimitOptions[0];

                // Add event listener to the drop down menu.
                HealthLimit.onValueChanged.AddListener((value) => SetHealthLimit(value));
            }
            #endregion

            #region Create room buttom
            if (CreateRoomButton)
            {
                CreateRoomButton.onClick.AddListener(delegate { OnClikedCreateRoomButton(); });
                CreateRoomButton.interactable = false;
                CreateRoomButton.GetComponentInChildren <Text>().text =
                    GameLanguageManager.GetText(GameLanguageManager.KeyWord.CreR_NeedAName, GameLanguageManager.CurrentLanguage);
            }
            #endregion

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #14
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIframework.UIManager.SceneUIs.SettingsWindowUI,
                UIframework.UIManager.DisplayUIMode.HideOthers,
                UIframework.UIManager.UITypes.AboveBlurEffect,
                false, true, true);

            m_Animator = GetComponent <Animator>();
#if UNITY_EDITOR
            if (!m_Animator)
            {
                Debug.LogError("Animator is null.");
            }
            if (!m_LanguageSettingHeader)
            {
                Debug.LogError("Language settings header is null.");
            }
            if (!m_LanguageSetting)
            {
                Debug.LogError("Language settings is null.");
            }
            if (!m_SettingsWindowHeader)
            {
                Debug.LogError("Settings window header is null.");
            }
            if (!m_SaveButton)
            {
                Debug.LogError("Save button is null");
            }
            if (!m_ReturnButton)
            {
                Debug.LogError("Return button is null");
            }
#endif
            m_SaveButton.onClick.AddListener(delegate { OnClickedSaveButton(); });
            m_ReturnButton.onClick.AddListener(delegate { OnClickedReturnButton(); });

            #region language settings dropdown menu
            if (m_LanguageSetting)
            {
                foreach (var item in Enum.GetValues(typeof(GameLanguageManager.SupportedLanguage)))
                {
                    m_LanguageSetting.options.Add(new Dropdown.OptionData()
                    {
                        text = GameLanguageManager.GetText(GameLanguageManager.KeyWord.Sett_LanguageCategory, (GameLanguageManager.SupportedLanguage)item)
                    });
                }

                // We need this step to refresh the options list.
                m_LanguageSetting.value = 1;
                m_LanguageSetting.value = 0;

                // Set default values.
                // m_LanguageIndex = 0;

                // Add event listener to the drop down menu.
                m_LanguageSetting.onValueChanged.AddListener((value) => OnSelectedLanguage(value));
            }
            #endregion

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }
예제 #15
0
        public override void InitUI()
        {
            base.InitUI();

            Properties = new UIProperties(
                UIManager.SceneUIs.HelperWindowUI,
                UIManager.DisplayUIMode.HideOthers,
                UIManager.UITypes.AboveBlurEffect,
                false, true, true);

            #region Help info category dropdown menu
            if (m_HelpInfoCategory)
            {
                foreach (var item in Enum.GetValues(typeof(HelperInfoManager.HelpInfoCategory)))
                {
                    m_HelpInfoCategory.options.Add(new Dropdown.OptionData()
                    {
                        text = HelperInfoManager.GetCategroyText((HelperInfoManager.HelpInfoCategory)item)
                    });
                }

                // We need this step to refresh the options list.
                m_HelpInfoCategory.value = 1;
                m_HelpInfoCategory.value = 0;

                // Set default values.
                m_CurrentSelectedCategoryIndex = 0;

                // Add event listener to the drop down menu.
                m_HelpInfoCategory.onValueChanged.AddListener((value) => OnSeletedHelperCategory(value));
            }
            #endregion

            #region Help info list
            // Populate the help info buttons.
            if (HelpInfoButtonPrefab)
            {
                m_ButtonList.Clear();
                for (int index = 0; index < m_HelpInfoButtonCount; index++)
                {
                    HelpInfoButtonUI button = Instantiate(HelpInfoButtonPrefab).GetComponent <HelpInfoButtonUI>();
                    GameUtility.AddChildToParent(m_HelpInfoListRoot, button.transform);
                    m_ButtonList.Add(button);
                    button.Init(index);
                }

                OnUpdateHelperInfoButtonList(m_CurrentSelectedCategoryIndex);
            }
            else
            {
#if UNITY_EDITOR
                Debug.LogError("HelpInfoButtonPrefab is NULL");
#endif
            }
            #endregion

            #region Helper info contents
#if UNITY_EDITOR
            if (!m_HelperInfoHeader)
            {
                Debug.LogError("Helper info header is null");
            }
            if (!m_HelperInfoImage)
            {
                Debug.LogError("Helper info image is null");
            }
            if (!m_HelperInfoContext)
            {
                Debug.LogError("Helper info context is null");
            }
#endif
            #endregion

            #region Window active animation
            m_Animator = GetComponent <Animator>();
#if UNITY_EDITOR
            if (!m_Animator)
            {
                Debug.LogError("Animator component in " + this.gameObject.name + " is null.");
            }
#endif
            #endregion

            if (!m_HelperWindowHeaderText)
            {
                Debug.LogError("Header text component in " + this.gameObject.name + " is null.");
            }

            if (!m_ReturnButton)
            {
                Debug.LogError("Return button component in " + this.gameObject.name + " is null.");
            }
            m_ReturnButton.onClick.AddListener(delegate { OnClickReturnButton(); });

            SetLanguage(GameLanguageManager.CurrentLanguage);
        }