Search Unity

Just a small tween example

Discussion in 'Made With Unity' started by robhuhn, Jul 18, 2009.

  1. robhuhn

    robhuhn

    Joined:
    Jun 21, 2009
    Posts:
    113
    Hey all,

    i made a small tween example using some easing functions. May be i will continue this project in the future
    (depends on how you like it :wink: )

    For now only GameObjects can be tweened from any position to any position. Next step would be to tween any property of an object.

    Please click a window and then a body to link them.
    The button "tween" will start all assigned tweens.
    http://unity.webdiscdrive.com/tween/

    Here a code snippet:

    Code (csharp):
    1.  
    2. //how to assign a tween
    3. Tween tween = targetObject.GetComponent("Tween") as Tween;
    4. if (!tween)
    5.     tween = targetObject.AddComponent("Tween") as Tween;
    6. tween.to(Vector3.up, Vector3.down, duration, new EaseDelegate(Back.EaseOut));
    7.  

    Those who use tweens in Flash will probably know the types of easing for those who don't can find a description here
    http://hosted.zeh.com.br/tweener/docs/en-us/misc/transitions.html


    And thanks to shaun! I took his DropDownMenu :wink:
     
  2. krys64

    krys64

    Joined:
    Mar 4, 2009
    Posts:
    36
    Hello

    i am inrested by your script, can you comunnicate me an example with all the code please ?

    thx