AtticArcade / hotween

Automatically exported from code.google.com/p/hotween
0 stars 0 forks source link

Please add "_TintColor" to material color tweening #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
would be nice to have "_TintColor" support for tweening any custom color 
property on a material.

Original issue reported on code.google.com by fouls...@soapcreative.com on 11 Mar 2014 at 7:35

GoogleCodeExporter commented 8 years ago
You can already do that with PlugSetColor :) 
http://hotween.demigiant.com/documentation.html#tweenplugins

Original comment by daniele....@gmail.com on 11 Mar 2014 at 8:04

GoogleCodeExporter commented 8 years ago
How? The documentation is a little confusing.

example:

Debug.Log(renderer.sharedMaterial.GetColor("_TintColor")); //Returns RGBA (0.5, 
0.5, 0.5, 1)

HOTween.To(renderer.sharedMaterial, 1f, new TweenParms().Prop("_TintColor", new 
PlugSetColor(Color.white, false))); // HOTween : 
"(UnityEngine.Material).TintColor" is missing, static, or not public. The tween 
for this property will not be created.

Original comment by fouls...@soapcreative.com on 11 Mar 2014 at 8:14

GoogleCodeExporter commented 8 years ago
You are so right. Will fix the web docs after writing here.

Here you go:

.Prop("color", new PlugSetColor(Color.red).Property("_TintColor"))

the first property name, in this case "color", is actually not necessary, and 
is there just because HOTween expects a property name as the first Prop 
parameter.

Original comment by daniele....@gmail.com on 11 Mar 2014 at 8:29

GoogleCodeExporter commented 8 years ago
ah great, it works. Thanks

Original comment by fouls...@soapcreative.com on 11 Mar 2014 at 8:32