iTween: How to animate other shader-color values besides the main Color?

Hi,

is it possible with iTween to tween other Shader-color values like “_SpecColor” or “_ReflectColor” or any custom shader values?
The current tween parameters like “ColorFrom/ColorTo/ColorUpdate” only edit the MainColor…

For example i use Ani.Mate for tweening like this (but would love to use iTween only):

meshArray.renderer.sharedMaterial.SetColor("_SpecColor", Color.red);

Thanks for any help on that.

I don’t know if this is still needed, but I’ve searched in many places and didn’t find an answer.

You need to change the iTweenScript to be able to handle this. Is a small change, just add “_TintColor” to the NamedValueColor enum. It should be like this:

public enum NamedValueColor{
		/// <summary>
		/// The main color of a material. Used by default and not required for Color methods to work in iTween.
		/// </summary>
		_Color,
		/// <summary>
		/// The specular color of a material (used in specular/glossy/vertexlit shaders).
		/// </summary>
		_SpecColor,
		/// <summary>
		/// The emissive color of a material (used in vertexlit shaders).
		/// </summary>
		_Emission,
		/// <summary>
		/// The reflection color of the material (used in reflective shaders).
		/// </summary>
		_ReflectColor,
		_TintColor

	}

After that, just use ColorTo normally:

iTween.ColorTo(gameObject,{"a": 0.3,"time":1,"namedcolorvalue": "_TintColor", "loopType":"pingPong", "easeType":"easeInOutQuad", "includeChildren":true});