Esempio n. 1
0
 public void SetUpSingleSub(Subtitles sub)
 {
     ResetSubs();
     FadeIn();
     StartCoroutine(ShowSubs(sub.text, 0));
     StartCoroutine(MyCoroutines.StartTimer(sub.duration, FadeOut));
 }
Esempio n. 2
0
    public void SetUpSubs(Subtitles[] subs)
    {
        FadeIn();
        float previousTime = 0;

        for (int i = 0; i < subs.Length; i++)
        {
            subs[i].text = subs[i].text.Replace("[Name]", "Henk");
            subs[i].text = subs[i].text.Replace("Dolores", "ICARUS");

            if (i != 0)
            {
                previousTime += subs[i - 1].duration;
            }
            StartCoroutine(ShowSubs(subs[i].text, previousTime));

            if (subs[i].playSoundAction != null)
            {
                //if (subs[i].playSoundAction.audioSourceToUse == null) subs[i].playSoundAction.audioSourceToUse =
                //        GlobalObjectManager.Instance.player.GetComponent<AudioSource>();
                if (subs[i].playSoundAction.audioSourceToUse != null && subs[i].playSoundAction.audioClipToUse != null)
                {
                    StartCoroutine(PlaySubs(subs[i].playSoundAction, previousTime));
                }
            }
        }
        StartCoroutine(MyCoroutines.StartTimer(previousTime + subs[subs.Length - 1].duration, FadeOut));
    }
Esempio n. 3
0
 public void PopUp(bool fadeout = true)
 {
     StopAllCoroutines();
     if (objectiveObject != null)
     {
         FadeIn();
         if (fadeout)
         {
             StartCoroutine(MyCoroutines.StartTimer(_fadeOutAfter, FadeOut));
         }
     }
 }
Esempio n. 4
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject == _playerRef)
        {
            ActivateAction();
            //enabled = false;
            //if (_destroyGameObjectAfterTouch) Destroy(gameObject);
            switch (_triggerAftermath)
            {
            case TriggerAftermath.DestroyThisComponent: Destroy(this); break;

            case TriggerAftermath.DisableThisComponent: enabled = false; break;

            case TriggerAftermath.DestroyThisGameObject: Destroy(gameObject); break;

            case TriggerAftermath.DisableThisGameObject: gameObject.SetActive(false); break;

            case TriggerAftermath.RemoveActionsFromList: actions.Clear(); break;

            case TriggerAftermath.DisableThisComponentAndRemoveAllActions:
            {
                actions.Clear();
                enabled = false;
                break;
            }

            case TriggerAftermath.DisableThisComponentAndAllActions:
            {
                foreach (BaseAction action in actions)
                {
                    if (action.isActiveAndEnabled)
                    {
                        action.enabled = false;
                    }
                }
                enabled = false;
                StartCoroutine(MyCoroutines.StartTimer(0.1f, Disable));         //ensure it's disabled
                break;
            }

            case TriggerAftermath.DestroyThisComponentAndAllActions:
            {
                foreach (BaseAction action in actions)
                {
                    Destroy(action);
                }
                Destroy(this);
                break;
            }
            }
        }
    }
    IEnumerator FadeInOut(string nameScene)
    {
        m_FadePanel.SetActive(true);
        m_FadeAnimator.Play("FadeIn");

        yield return(StartCoroutine(MyCoroutines.WaitForRealSeconds(1f)));

        SceneManager.LoadScene(nameScene);
        m_FadeAnimator.Play("FadeOut");

        yield return(StartCoroutine(MyCoroutines.WaitForRealSeconds(1f)));

        m_FadePanel.SetActive(false);
    }
Esempio n. 6
0
 public void PopUp()
 {
     StopAllCoroutines();
     FadeIn();
     StartCoroutine(MyCoroutines.StartTimer(_fadeOutAfter, FadeOut));
 }
Esempio n. 7
0
 public override void Action()
 {
     //StopAllCoroutines();
     StartCoroutine(MyCoroutines.StartTimer(afterHowManySeconds, ActivateAction));
 }
Esempio n. 8
0
 private void OnEnable()
 {
     StartCoroutine(MyCoroutines.StartTimer(afterHowManySeconds, OnTime));
 }