コード例 #1
0
ファイル: QuestManager.cs プロジェクト: Stumpstump/RoverGame
        protected IEnumerator DisplayDialogueCoroutine(List<DisplayDialogue> displayTexts, QuestObjective qo, bool isHuman = true)
        {
            for(int i = 0; i < displayTexts.Count; i++)
            {
                qo.questTrigger.Initialize();
                DisplayDialogue dd = displayTexts[i];

                float delay = dd.displayText.Length * characterDelay;
                
                float desiredTime = delay;

                if (dd.clip != null)
                {
                    desiredTime = dd.clip.length;
                    delay = dd.clip.length;
                    SoundSource ss = GameManager.Get<SoundManager>().Play(dd.clip);
                    if(isHuman && radioAmg != null) ss.cachedAudioSource.outputAudioMixerGroup = radioAmg;
                    if (!isHuman && aiAmg != null) ss.cachedAudioSource.outputAudioMixerGroup = aiAmg;
                }
                UIManager.GetMenu<ObjectiveTracker>().Open(dd.displayText, isHuman, true, delay);
                desiredTime += 0.75f;

                switch(dd.effect)
                {
                    case Sol.DisplayDialogue.DisplayEffect.Glitch:
                        StartCoroutine(GlitchOut(dd.duration));
                        break;

                    case Sol.DisplayDialogue.DisplayEffect.FadeIn:
                        UIManager.GetMenu<FadeMenu>().Fade(dd.duration, Color.black, Color.clear);
                        break;

                    case Sol.DisplayDialogue.DisplayEffect.FadeOut:
                        UIManager.GetMenu<FadeMenu>().Fade(dd.duration, Color.clear, Color.black, true);
                        break;

                    case Sol.DisplayDialogue.DisplayEffect.None:
                    default:
                        break;
                }

                float elapsedTime = 0f;

                while(elapsedTime < desiredTime)
                {
                    elapsedTime += Time.deltaTime;
                    //if (GameManager.Get<QuestManager>().testMode && Input.GetKeyDown(KeyCode.Return)) break;
                    yield return null;
                }
            }

            while(!canProceed)
            {
                yield return null;
            }

            CurrentQuest.CompleteObjective(endQuest, targetQuest);
            canProceed = false;
        }
コード例 #2
0
ファイル: QuestManager.cs プロジェクト: yazici/RoverGame
        protected IEnumerator DisplayDialogueCoroutine(List <DisplayDialogue> displayTexts, QuestObjective qo, bool isHuman = true)
        {
            for (int i = 0; i < displayTexts.Count; i++)
            {
                qo.questTrigger.Initialize();
                DisplayDialogue dd = displayTexts[i];

                float delay = dd.displayText.Length * characterDelay;

                float desiredTime = delay;

                if (dd.clip != null)
                {
                    desiredTime = dd.clip.length;
                    delay       = dd.clip.length;
                    SoundSource ss = GameManager.Get <SoundManager>().Play(dd.clip);
                    if (isHuman && radioAmg != null)
                    {
                        ss.cachedAudioSource.outputAudioMixerGroup = radioAmg;
                    }
                    if (!isHuman && aiAmg != null)
                    {
                        ss.cachedAudioSource.outputAudioMixerGroup = aiAmg;
                    }
                }
                UIManager.GetMenu <ObjectiveTracker>().Open(dd.displayText, isHuman, true, delay);
                desiredTime += 0.75f;

                switch (dd.effect)
                {
                case Sol.DisplayDialogue.DisplayEffect.Glitch:
                    StartCoroutine(GlitchOut(dd.duration));
                    break;

                case Sol.DisplayDialogue.DisplayEffect.FadeIn:
                    UIManager.GetMenu <FadeMenu>().Fade(dd.duration, Color.black, Color.clear);
                    break;

                case Sol.DisplayDialogue.DisplayEffect.FadeOut:
                    UIManager.GetMenu <FadeMenu>().Fade(dd.duration, Color.clear, Color.black, true);
                    break;

                case Sol.DisplayDialogue.DisplayEffect.None:
                default:
                    break;
                }

                float elapsedTime = 0f;

                while (elapsedTime < desiredTime)
                {
                    elapsedTime += Time.deltaTime;
                    //if (GameManager.Get<QuestManager>().testMode && Input.GetKeyDown(KeyCode.Return)) break;
                    yield return(null);
                }
            }

            while (!canProceed)
            {
                yield return(null);
            }

            CurrentQuest.CompleteObjective(endQuest, targetQuest);
            canProceed = false;
        }
コード例 #3
0
ファイル: QuestManager.cs プロジェクト: Stumpstump/RoverGame
 public virtual void DisplayDialogue(List<DisplayDialogue> displayTexts, QuestObjective qo, bool isHuman = true)
 {
     StartCoroutine(DisplayDialogueCoroutine(displayTexts, qo, isHuman));
 }
コード例 #4
0
ファイル: QuestManager.cs プロジェクト: yazici/RoverGame
 public virtual void DisplayDialogue(List <DisplayDialogue> displayTexts, QuestObjective qo, bool isHuman = true)
 {
     StartCoroutine(DisplayDialogueCoroutine(displayTexts, qo, isHuman));
 }