public IEnumerator PerformTimeScaleTween(SlowDownEffectData data) { yield return(DOTween.To(() => Time.timeScale, x => Time.timeScale = x, data.Amount, data.InDuration).SetEase(data.EaseIn).SetUpdate(true).WaitForCompletion()); yield return(new WaitForSecondsRealtime(data.holdDuration)); yield return(DOTween.To(() => Time.timeScale, x => Time.timeScale = x, 1, data.OutDuration).SetEase(data.EaseOut).SetUpdate(true).WaitForCompletion()); }
public static void Play(this SlowDownEffectData data) { if (data == null) { return; } EffectsController.Instance.PlaySlowDownEffect(data); }
public void PlaySlowDownEffect(SlowDownEffectData data) { StartCoroutine(PerformTimeScaleTween(data)); }