using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace TweenAnimation { [Serializable] public class TweenAlpha : TweenModule { public float from; public float to; public Graphic graphic; protected override void SetValue(float time) { float t = time / duration; float alpha = Mathf.Lerp(from, to, t); if (graphic != null) { Color c = graphic.color; c.a = alpha; graphic.color = c; } } #if UNITY_EDITOR public override string name { get { return "Alpha"; } } #endif } }