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; }
public void Toggle(bool isOpen) { if (isOpen) { _easingControl.Play(); } else { _easingControl.Reverse(); } }
void Start() { ec = gameObject.AddComponent <EasingControl>(); ec.startValue = -5; ec.endValue = 5; ec.duration = 3; ec.loopCount = -1; // inifinite looping ec.loopType = EasingControl.LoopType.PingPong; ec.equation = EasingEquations.EaseInOutQuad; ec.UpdateEvent += OnUpdateEvent; ec.Play(); }
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; }
public void Activate() { canvas.SetActive(true); if (!easing) { easing = gameObject.AddComponent <EasingControl>(); } easing.duration = 1f; easing.equation = EasingEquations.EaseInOutQuad; easing.endBehaviour = EasingControl.EndBehaviour.Constant; easing.updateEvent += OnUpdateEvent; easing.Play(); _seconds = 0; secondsTracker = _seconds; minutesTracker = _seconds; text.text = string.Format("{0}:{1}", MinutesPassed, System.Math.Round(Mathf.Clamp(SecondsPassed - (MinutesPassed * 60), 0, 59.99f), 2)); }
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); }
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; }