com.alicizax.unity.animatio.../Runtime/Core/Property/GraphicAlpha.cs
陈思海 11e5744b46 init
2025-02-07 16:05:13 +08:00

37 lines
927 B
C#

using UnityEngine;
using UnityEngine.UI;
namespace AlicizaX.AnimationFlow.Runtime {
[Category("Property")]
public class GraphicAlpha : ActionNode {
public Graphic target;
public float alpha;
protected float orgValue;
public override void OnInit() {
orgValue = target.color.a;
}
public override void OnReset() {
target.color = new Color(target.color.r, target.color.g, target.color.b, orgValue);
}
public override void OnEnter() {
target.color = new Color(target.color.r, target.color.g, target.color.b, alpha);
}
public override bool Valid() {
return target != null;
}
public override bool HasSubTitle() {
return true;
}
public override string SubTitle() {
return target != null ? target.name : null;
}
}
}