internal BaseTween SetFloatProperty(Material material, int propertyHash, float value, float t) { ValueTween tween = TweenPool.GetValueTween(material.GetFloat(propertyHash), value, t); tween.SetOnUpdateFloat(v => material.SetFloat(propertyHash, v)); return(ProcessTween(tween)); }
public BaseTween ColorTween(Image image, Color to, float t) { ColorTween tween = TweenPool.GetColorTween(image.color, to, t); tween.SetOnUpdateColor(delegate(Color c) { if (image == null) { CancelTween(tween); return; } image.color = c; }); return(ProcessTween(tween)); }
public BaseTween ColorTween(SpriteRenderer sprite, Color to, float t) { ColorTween tween = TweenPool.GetColorTween(sprite.color, to, t); tween.SetOnUpdateColor(delegate(Color c) { if (sprite == null) { TweenPool.FinishTween(tween); return; } sprite.color = c; }); return(ProcessTween(tween)); }
public BaseTween Fade(CanvasGroup cg, float to, float t) { ValueTween tween = TweenPool.GetValueTween(cg.alpha, to, t); tween.SetOnUpdateFloat(delegate(float v) { if (cg == null) { CancelTween(tween); return; } cg.alpha = v; }); return(ProcessTween(tween)); }
public BaseTween Move(Transform obj, Vector3 to, float t) { Vector3Tween tween = TweenPool.GetVector3Tween(obj.position, to, t); tween.PauseReset += () => tween.Init(obj.position, to, t); tween.SetOnUpdateVector3((Vector3 pos) => { if (obj == null) { CancelTween(tween); return; } obj.position = pos; }); return(ProcessTween(tween)); }
public BaseTween Fade(SpriteRenderer sprite, float to, float t) { ValueTween tween = TweenPool.GetValueTween(sprite.color.a, to, t); tween.SetOnUpdateFloat(delegate(float v) { if (sprite == null) { CancelTween(tween); return; } Color c = sprite.color; c.a = v; sprite.color = c; }); return(ProcessTween(tween)); }
public BaseTween Fade(Image image, float to, float t) { ValueTween tween = TweenPool.GetValueTween(image.color.a, to, t); tween.SetOnUpdateFloat(v => { if (image == null) { CancelTween(tween); return; } Color c = image.color; c.a = v; image.color = c; }); return(ProcessTween(tween)); }
public BaseTween RotateTween(Transform t, Quaternion to, float time) { QuaternionTween tween = TweenPool.GetQuaternionTween(t.rotation, to, time); tween.SetOnUpdateQuaternion(delegate(Quaternion v) { if (t != null) { t.rotation = v; } else { CancelTween(tween); } }); return(ProcessTween(tween)); }
public BaseTween ScaleTween(Transform t, Vector3 to, float time) { Vector3Tween tween = TweenPool.GetVector3Tween(t.localScale, to, time); tween.PauseReset += () => tween.Init(t.localScale, to, time); tween.SetOnUpdateVector3(delegate(Vector3 v) { if (t == null) { CancelTween(tween); return; } t.localScale = v; }); return(ProcessTween(tween)); }
public BaseTween Move(Transform obj, Transform to, float t) { MoveTween tween = TweenPool.GetMoveTween(obj, to, t); return(ProcessTween(tween)); }
public BaseTween ValueTween(float from, float to, float t) { var tween = TweenPool.GetValueTween(from, to, t); return(ProcessTween(tween)); }
public BaseTween VectorTween(Vector3 from, Vector3 to, float t) { Vector3Tween tween = TweenPool.GetVector3Tween(from, to, t); return(ProcessTween(tween)); }
public BaseTween ColorTween(Color from, Color to, float t) { ColorTween tween = TweenPool.GetColorTween(from, to, t); return(ProcessTween(tween)); }