/// <summary> /// Call this to fade out the CanvasGroup reliably /// </summary> public void FadeOut() { if (runningCoroutine != null) { AssociatedController.StopCoroutine(runningCoroutine); } runningCoroutine = AssociatedController.StartCoroutine(Fade(FadeMethod.FadeOut)); }
/// <summary> /// Call this under MonoBehaviour.Update(); ensures the extension functions properly /// </summary> public void Update() { sliderWaitTimer += Time.deltaTime; if (SliderIsStale && sliderWaitTimer >= SliderLengthBetweenTransitions) { if (runningCoroutine != null) { AssociatedController.StopCoroutine(runningCoroutine); } runningCoroutine = AssociatedController.StartCoroutine(TransitionSlider(AssociatedSlider, AssociatedSlider.value, SliderStaleValue, SliderTransitionLength)); SliderIsStale = false; sliderWaitTimer = 0; } }