Beispiel #1
0
        /// <summary>
        /// Translation of every text listened from event
        /// </summary>
        public void TranslateTexts()
        {
            // MAIN GROUP
            m_loadGameButtonText.text = GJ_TextManager.GetText(GJ_TextSetup.Menu.CONTINUE);
            m_newGameButtonText.text  = GJ_TextManager.GetText(GJ_TextSetup.Menu.NEW_GAME);
            m_optionsButtonText.text  = GJ_TextManager.GetText(GJ_TextSetup.Menu.OPTIONS);
            m_creditsButtonText.text  = GJ_TextManager.GetText(GJ_TextSetup.Menu.CREDITS);
            m_exitButtonText.text     = GJ_TextManager.GetText(GJ_TextSetup.Menu.EXIT);

            // OPTIONS GROUP
            m_optionsTitleText.text = GJ_TextManager.GetText(GJ_TextSetup.Menu.OPTIONS_TITLE);
            m_volumeText.text       = GJ_TextManager.GetText(GJ_TextSetup.Menu.VOLUME);
            m_graphicsText.text     = GJ_TextManager.GetText(GJ_TextSetup.Menu.GRAPHICS);
            m_languageText.text     = GJ_TextManager.GetText(GJ_TextSetup.Menu.LANGUAGE);
            m_backText.text         = GJ_TextManager.GetText(GJ_TextSetup.Menu.BACK);

            // CREDITS GROUP
            m_creditsTitleText.text      = GJ_TextManager.GetText(GJ_TextSetup.Menu.OPTIONS_TITLE);
            m_creditsText.text           = GJ_TextManager.GetText(GJ_TextSetup.Menu.CREDITS_TEXT);
            m_creditsBackButtonText.text = GJ_TextManager.GetText(GJ_TextSetup.Menu.BACK);

            // Parse quality
            string[] names = QualitySettings.names;
            m_graphicsDropdown.ClearOptions();
            List <Dropdown.OptionData> newList = new List <Dropdown.OptionData>();

            foreach (string name in names)
            {
                string n = GJ_TextManager.GetText(name);
                newList.Add(new Dropdown.OptionData(n));
            }

            m_graphicsDropdown.AddOptions(newList);

            //Parse languages
            m_languagesDropdown.ClearOptions();
            newList = new List <Dropdown.OptionData>();
            foreach (SystemLanguage language in GJ_TextManager.Instance.ActiveLanguages)
            {
                newList.Add(new Dropdown.OptionData(GJ_TextManager.GetText(language.ToString())));
            }
            m_languagesDropdown.AddOptions(newList);
        }
        /// <summary>
        /// Coroutine called for loading the next scene
        /// </summary>
        /// <param name="_index"></param>
        /// <param name="_delayAfterLoading"></param>
        /// <param name="_eventName"></param>
        /// <returns></returns>
        IEnumerator LoadingScreen(int _index, float _delayAfterLoading = 1f, string _eventName = "")
        {
            m_loadingScreenGroup.SetActive(true);
            m_loadingText.text = GJ_TextManager.GetText(GJ_TextSetup.LoadingScreen.LOADING_TEXT);

            AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(_index);

            // Wait until the asynchronous scene fully loads
            while (!asyncLoad.isDone)
            {
                yield return(null);
            }

            yield return(new WaitForSeconds(_delayAfterLoading));

            m_loadingScreenGroup.SetActive(false);

            if (_eventName != "")
            {
                GJ_EventManager.TriggerEvent(_eventName);
            }
        }