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 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 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 ValueTween(float from, float to, float t) { var tween = TweenPool.GetValueTween(from, to, t); return(ProcessTween(tween)); }