/// <summary> /// Disapear this instance. /// </summary> protected virtual void Disapear() { Color newColor = new Color(0, 0, 0, 0); StartCoroutine(FadeEffect.FadeEffectImage(InstructionsPanel, FadeDuration, newColor)); StartCoroutine(FadeEffect.FadeEffectText(InstructionsText, FadeDuration, newColor)); Invoke("DestroyInstructions", FadeDuration); }
/// <summary> /// Fades the fader. /// </summary> /// <param name="newcolor">Newcolor.</param> /// <param name="duration">Duration.</param> public virtual void FadeFader(Color newcolor, float duration) { if (FaderEffect == null) { return; } FaderEffect.gameObject.SetActive(true); StartCoroutine(FadeEffect.FadeEffectImage(FaderEffect, duration, newcolor)); }
public virtual void FadeEffectOn(bool state, float duration) { if (FaderEffect == null) { return; } FaderEffect.gameObject.SetActive(true); if (state) { StartCoroutine(FadeEffect.FadeEffectImage(FaderEffect, duration, new Color(0, 0, 0, 1f))); } else { StartCoroutine(FadeEffect.FadeEffectImage(FaderEffect, duration, new Color(0, 0, 0, 0f))); } }