Search Unity

iTween and NGUI scale issue.

Discussion in 'Editor & General Support' started by aholla, May 28, 2014.

  1. aholla

    aholla

    Joined:
    May 27, 2014
    Posts:
    81
    Hi, I have a UIbutton with a UIButtonScale applied to it. On the 'hover' state it should scale up to 1.2. This works fine with just NGUI but if I do any tweens to the button using iTween, the NGUI Tween on the 'hover' no longer scales up but scales to zero instead.

    Here is my iTween code:

    Code (csharp):
    1.  
    2. iTween.ScaleFrom(   child.gameObject, iTween.Hash( "x", 0.0f, "y", 0.0f, "time", 1.0f  ) );
    3.  
    I have found that it is related to the "ScaleFrom", if i use "ScaleTo" it is fine but I have to do multiple tweens to achieve the same result (or set the values manually):

    Code (csharp):
    1.  
    2. iTween.ScaleTo( child.gameObject, iTween.Hash( "x", 0.0f, "y", 0.0f, "time", 0.0f ) );
    3. iTween.ScaleTo( child.gameObject, iTween.Hash( "x", 1.0f, "y", 1.0f, "time", 1.0f, "delay", 0.01 ) ); // needs a delay or overrides the old one.
    4.  
    Any ideas?