itween's ColorTo with Specular, reflection emissive co

Looking to itween source code I noted that the ColorTo and ColorFrom functions can be used to change specular, reflection and emisive colors with only a few changes:

Change lines with code like:

colors[i,0]=renderer.materials[i].color

with

colors[i,0]=renderer.materials[i].GetColor("_ReflectColor"); // _SpecColor, _Emission or _Color

and change lines with code like

renderer.materials[i].color=colors[i,2]

with

renderer.materials[i].SetColor("_ReflectColor", colors[i, 2] ); // _SpecColor, _Emission or _Color

I Hope that this commentary helps to improve itween library.

Thanks for the heads up on this approach! You can also use the ValueTo methods to do this. I guess I should add an option to pass in which colors you’d like to adjust?

Yes, it would be nice to have a property in ColorTo and ColorFrom to specify the color name to be used (_Color as default).

Thank you for pointing me to the ValueTo function. I will take a look at it.

I’ll get working on the new addition to the Color methods as soon as I can. Do you see a need for this in the Fade methods?

Personally, I don’t think it is necesary in the Fade methods.

Thank you very much!

You can now tell iTween to animate your specular, reflection and emisive colors with the ColorTo() and ColorFrom() methods by sending the “namedcolorvalue” property!!

For example sent using the enum version:

iTween.ColorTo(gameObject,iTween.Hash("color",Color.red,"time",2,"delay",1,"namedcolorvalue",iTween.NamedValueColor._Emission));

and just sent as a string:

iTween.ColorTo(gameObject,iTween.Hash("color",Color.red,"time",2,"delay",1,"namedcolorvalue","_Emission"));

Great! I have tried it and it works beautifully.

Thank you very much!

Great! I have tried it and it works beautifully.

Thank you very much!

Awesome. Let me know if you have any other ideas to help push iTween!