x


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.

more ▼

asked May 30 '11 at 11:01 AM

yosh gravatar image

yosh
961 77 83 96

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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});
more ▼

answered Aug 03 '11 at 02:00 AM

tiagomelobr gravatar image

tiagomelobr
86 4 4 5

I've forgot to remember you, you need to change "_TintColor" for whenever value you like!

Aug 03 '11 at 02:02 AM tiagomelobr

Hey everyone, thanks in advance for all the help.

This seems to address exactly what I am having trouble with, the only issue is that I am using the iTween Visual Editor and am not able to use ColorTo as referenced above. Im not a programmer, so the Visual Editor has been great for creating all the animated color shifts, I just cant get it to change my particle colors.

Do you know how I can add _TintColor to the iTweenEvent script so that I can change the Tint Color of Particles using the iTween Visual Editor rather than calling it from a script? Ive been digging around in all the iTween scripts to no avail.

Thanks, Austinj

May 15 '12 at 03:17 PM austinj

Thank you thank you thank you tiagomelobr. That's exactly what I needed (modifying the NamedValueColor enum).

Aug 01 '13 at 10:40 PM justinl
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5701
x778
x540

asked: May 30 '11 at 11:01 AM

Seen: 3374 times

Last Updated: Aug 01 '13 at 10:40 PM