private void Appear() { CanvasGroup.alpha = Mathf.Lerp(minimum, maximum, Mathf.SmoothStep(0.0f, 1.0f, Mathf.SmoothStep(0.0f, 1.0f, t))); // .. and increase the t interpolater t += fadeSpeed * Time.deltaTime; // now check if the interpolator has reached 1.0 // and swap maximum and minimum so game object moves // in the opposite direction. if (t > 1.0f) { handler -= Appear; } }
public void MouseExit() { handler += Disappear; handler -= Appear; }
public void MouseEnter() { handler += Appear; handler -= Disappear; }