public static Coroutine Fade(this UGUIParts self, float duration, float targetAlpha) { var startAlpha = self.Alpha; return(self.StartCoroutine(KKUtilities.FloatLerp(duration, (t) => { self.Alpha = Mathf.Lerp(startAlpha, targetAlpha, Easing.InQuad(t)); }))); }
public virtual void Show() { panel.gameObject.SetActive(true); Container.SetActive(true); Alpha = 1; StartCoroutine(KKUtilities.FloatLerp(showAnimationTime * 0.5f, (t) => { panel.Alpha = Mathf.Lerp(0.0f, panel.DefaultAlpha, Easing.InQuad(t)); })); StartCoroutine(showAnimation.GetAnimation(this, showAnimationTime).OnCompleted(() => { OnShowAnimationEnd.Invoke(); })); }