public static TweenFloat Begin(GameObject obj, float duration, float fromValue, float toValue, ChangeValueDelegate changeValueDelegate, FinishCallBackDelegate finishCallBack, bool destroyObjWhenFinish = true) { if (fromValue == toValue) { if (changeValueDelegate != null) { changeValueDelegate(toValue); } if (finishCallBack != null) { finishCallBack(); } return(null); } GameObject tweenObj = obj; TweenFloat tweenFloatComponent = tweenObj.AddComponent <TweenFloat>(); tweenFloatComponent.BeginTweenFloat(duration, fromValue, toValue, changeValueDelegate, finishCallBack, destroyObjWhenFinish); return(tweenFloatComponent); }