private void DelayPlayEffect(UIEffectParameters effectParameters, float delay) { if (delay > Mathf.Epsilon) { StartCoroutine(PlayOneEffect(effectParameters, delay)); } else { effectParameters.Effect.Play(); } currentEffect = effectParameters.Effect; }
private IEnumerator PlayOneEffect(UIEffectParameters effectParameters, float delay) { yield return(new WaitForSeconds(delay)); effectParameters.Effect.Play(); }