private void OnTriggerExit(Collider other) { EffectArea ea = other.GetComponentInChildren <EffectArea>(); if (ea != null && ea.enabled && ea.areaEffect != null) { lastArea = ea; if (ea.removeOnExit) { RemoveEffect(ea.areaEffect); } StartCoroutine("EndAreaEffect"); } }
private IEnumerator EndAreaEffect() { yield return(new WaitForEndOfFrame()); lastArea = null; }