Пример #1
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == GJ_GameSetup.Tags.PLAYER)
     {
         GJ_EventManager.TriggerEvent(GJ_EventSetup.Game.DEAD);
     }
 }
Пример #2
0
 /// <summary>
 /// Get the language from index (a dropdown example) and translate every text
 /// </summary>
 /// <param name="language"></param>
 public void ChangeLanguageFromIndex(int language)
 {
     m_currentLanguage      = ActiveLanguages[language];
     m_currentLanguageIndex = language;
     PlayerPrefs.SetInt(GJ_GameSetup.PlayerPrefs.LAST_LANGUAGE, m_currentLanguageIndex);
     GJ_EventManager.TriggerEvent(GJ_EventSetup.Localization.TRANSLATE_TEXTS);
 }
Пример #3
0
 /// <summary>
 /// Method for changing the language. Calling this method will launch translate event so every text shows correctly
 /// </summary>
 /// <param name="language"></param>
 public void ChangeLanguage(SystemLanguage language)
 {
     m_currentLanguage      = language;
     m_currentLanguageIndex = m_activelanguages.IndexOf(m_currentLanguage);
     PlayerPrefs.SetInt(GJ_GameSetup.PlayerPrefs.LAST_LANGUAGE, m_currentLanguageIndex);
     GJ_EventManager.TriggerEvent(GJ_EventSetup.Localization.TRANSLATE_TEXTS);
 }
Пример #4
0
        public override void OnEnter()
        {
            if (!showAlways && executionCount >= showCount)
            {
                Continue();
                return;
            }

            executionCount++;

            // Override the active say dialog if needed
            if (character != null && character.SetSayDialog != null)
            {
                SayDialog.ActiveSayDialog = character.SetSayDialog;
            }

            if (setSayDialog != null)
            {
                SayDialog.ActiveSayDialog = setSayDialog;
            }

            var sayDialog = SayDialog.GetSayDialog();

            if (sayDialog == null)
            {
                Continue();
                return;
            }

            var flowchart = GetFlowchart();

            sayDialog.SetActive(true);

            sayDialog.SetCharacter(character);
            sayDialog.SetCharacterImage(portrait);

            string displayText = storyText;

            var activeCustomTags = CustomTag.activeCustomTags;

            for (int i = 0; i < activeCustomTags.Count; i++)
            {
                var ct = activeCustomTags[i];
                displayText = displayText.Replace(ct.TagStartSymbol, ct.ReplaceTagStartWith);
                if (ct.TagEndSymbol != "" && ct.ReplaceTagEndWith != "")
                {
                    displayText = displayText.Replace(ct.TagEndSymbol, ct.ReplaceTagEndWith);
                }
            }

            string subbedText = flowchart.SubstituteVariables(displayText);

            sayDialog.Say(subbedText, !extendPrevious, waitForClick, fadeWhenDone, stopVoiceover, waitForVO, voiceOverClip, delegate {
                GJ_EventManager.TriggerEvent(GJ_EventSetup.Game.CAN_MOVE);
                Continue();
            });
        }
Пример #5
0
        /// <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);
            }
        }
Пример #6
0
 /// <summary>
 /// Start a new Game from button
 /// </summary>
 public void NewGame()
 {
     GJ_EventManager.TriggerEvent(GJ_EventSetup.SaveData.NEW_GAME);
     GJ_SceneLoader.LoadScene(GJ_SceneSetup.SCENES.MANU_TEST, 1f, GJ_EventSetup.Menu.GO_TO_GAME);
     FungusManager.Instance.MusicManager.StopMusic();
 }