Exemplo n.º 1
0
    private IEnumerator WaitAndComplete(float t)
    {
        yield return(new WaitForSeconds(t + 1));

        mainAudioSource.DOFade(1f, .5f);
        OnIntroComplete?.Invoke();
    }
Exemplo n.º 2
0
 public void StartIntro(OnIntroComplete _completionCallback)
 {
     m_introComplete = _completionCallback;
     m_isInProgress  = true;
     m_animator.SetTrigger("Begin");
     m_miniGame.PlaySFX(mg_jr_Sound.GARY_INTRO_FLY_IN.ClipName());
     m_timeSinceDialogChange = float.MaxValue;
 }
Exemplo n.º 3
0
 private void AnimationEnded()
 {
     m_isInProgress  = false;
     IsIntroFinished = true;
     if (m_introComplete != null)
     {
         m_introComplete();
         m_introComplete = null;
     }
 }
Exemplo n.º 4
0
    private void ShowDialog()
    {
        if (possibleDialogs.Count > 0)
        {
            Dialog dialog = possibleDialogs[Random.Range(0, possibleDialogs.Count)];

            dialogImage.sprite = dialog.image;
            dialogText.text    = dialog.text;

            mainAudioSource.DOFade(.5f, 1f)
            .OnComplete(() =>
            {
                audioSource.PlayOneShot(dialog.audioClip);
                StartCoroutine(WaitAndComplete(dialog.audioClip.length));
            });
        }
        else
        {
            OnIntroComplete?.Invoke();
        }
    }