/// <summary> /// Start the tweening operation. /// </summary> static public TweenNumber Begin(GameObject go, float duration, int from, int to) { TweenNumber comp = UITweener.Begin <TweenNumber>(go, duration); comp.from = from; comp.to = to; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenNumber Begin(GameObject go, float duration, float startValue, float dstValue, string setHeader, string setFooter, float setRatio) { TweenNumber comp = UITweener.Begin <TweenNumber>(go, duration); comp.label = go.GetComponent <UILabel>(); if (comp.label == null) { return(null); } comp.from = startValue; comp.to = dstValue; comp.footer = setFooter; comp.header = setHeader; comp.ratio = setRatio; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }