protected virtual void Disappear() { Color newColor = new Color(0, 0, 0, 0); StartCoroutine(CorgiTools.FadeImage(InstructionsPanel, FadeDuration, newColor)); StartCoroutine(CorgiTools.FadeText(InstructionsText, FadeDuration, newColor)); Invoke("DestroyInstructions", FadeDuration); }
/// <summary> /// Fades the fader in or out depending on the state /// </summary> /// <param name="state">If set to <c>true</c> fades the fader in, otherwise out if <c>false</c>.</param> public virtual void FaderOn(bool state, float duration) { Fader.gameObject.SetActive(true); if (state) { StartCoroutine(CorgiTools.FadeImage(Fader, duration, new Color(0, 0, 0, 1f))); } else { StartCoroutine(CorgiTools.FadeImage(Fader, duration, new Color(0, 0, 0, 0f))); } }