public void Stop() { this.Log("Stopping"); if (active) { StopCoroutine(advanceRoutine); } backgroundComponent.CrossFadeAlpha(0f, 0f, ignoreTimeScale); canvasGroup.CrossFade(false); currentSlideNumber = 0; textComponent.text = string.Empty; imageComponent.sprite = null; advanceRoutine = null; }
public void Reset() { imageComponent.sprite = null; titleTextComponent.text = descriptionTextComponent.text = string.Empty; titleTextComponent.enabled = descriptionTextComponent.enabled = imageComponent.enabled = false; progressBar?.Toggle(false); continuePromptDisplay?.CrossFade(false); }
private void ToggleVisibility(bool show, float duration) { Action onFinished = null; if (show) { canvasGroup.gameObject.SetActive(true); } else { onFinished = () => canvasGroup.gameObject.SetActive(false); } canvasGroup.CrossFade(show ? 1f : 0f, show, show, duration, onFinished); }
public static void CrossFade(this CanvasGroup canvasGroup, bool fade, float duration, Action onFinished = null) { canvasGroup.CrossFade(fade ? 1f : 0f, fade, fade, duration, onFinished); }