IEnumerator Sequence()
    {
        SequencePlaying = true;
        ec.Play();
        while (ec.IsPlaying)
        {
            yield return(null);
        }
        if (toDisplay.Count > 1 && displayTime > 0)
        {
            displayTime -= 0.075f;
        }
        else if (toDisplay.Count == 0)
        {
            displayTime = 0.2f;
        }
        yield return(new WaitForSeconds(displayTime));

        ec.Reverse();
        while (ec.IsPlaying)
        {
            yield return(null);
        }
        canvas.SetActive(false);
        SequencePlaying = false;
    }
Beispiel #2
0
 public void Toggle(bool isOpen)
 {
     if (isOpen)
     {
         _easingControl.Play();
     }
     else
     {
         _easingControl.Reverse();
     }
 }
Beispiel #3
0
    IEnumerator Sequence()
    {
        SequencePlaying = true;
        easing.Play();
        while (easing.IsPlaying)
        {
            yield return(null);
        }
        yield return(new WaitForSeconds(0.2f));

        easing.Reverse();
        while (easing.IsPlaying)
        {
            yield return(null);
        }
        canvas.SetActive(false);
        SequencePlaying = false;
    }
Beispiel #4
0
        private IEnumerator Sequence()
        {
            ec.Play();

            while (ec.IsPlaying)
            {
                yield return(null);
            }

            yield return(new WaitForSeconds(1));

            ec.Reverse();

            while (ec.IsPlaying)
            {
                yield return(null);
            }

            canvas.SetActive(false);
        }
        /// <summary>
        /// <para>Inicia la secuencia del mensaje</para>
        /// </summary>
        /// <returns></returns>
        private IEnumerator Secuencia()        // Inicia la secuencia del mensaje
        {
            ec.Play();

            while (ec.IsPlaying)
            {
                yield return(null);
            }

            yield return(new WaitForSeconds(1));

            ec.Reverse();

            while (ec.IsPlaying)
            {
                yield return(null);
            }

            canvas.SetActive(false);
        }
Beispiel #6
0
    public void Toggle(bool visible)
    {
        if (this.visible == visible)
        {
            return;
        }

        if (visible)
        {
            easingControl.Play();
            InputController.moveEvent += OnMove;
            InputController.fireEvent += OnFire;
        }
        else
        {
            easingControl.Reverse();
            InputController.moveEvent -= OnMove;
            InputController.fireEvent -= OnFire;
        }

        this.visible = visible;
    }