Sortie de iTween pour Unity

Les tweens, que l’on trouve surtout dans Flash, sont une méthode permettant de déplacer, grossir, tourner facilement des objets dans un certains délais. J’avais déjà parlé de la classe Ani.mate que l’on trouve sur le Wiki mais qui est codée en Boo, donc inutilisable sur Unity Iphone.
Voici donc le projet iTween entièrement codé en Javascript et en C# et dérivé de Tweener de Flash apportant les méthodes suivantes :

iTween.punchPosition(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0
* Applies a jolt of force on the given axis and springs the GameObject back to its original position like a punching bag.
* Negative/positive values dictate the direction of the initial impact.
* Does not utilize a transition.

iTween.punchRotation(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0
* Applies a jolt of rotation force on the given axis based on a percentage or multiplier of 360 degrees and springs the GameObject back to its original position like a punching bag.
* Negative/positive values dictate the direction of the initial impact.
* Does not work on GUIText, GUITexture and similar display objects that do not support rotation.
* Does not utilize a transition.

iTween.moveTo(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, transition:String, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »easeInOutCubic »
* Moves the GameObject to the supplied coordinate(s).

iTween.moveFrom(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, transition:String, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »easeInOutCubic »
* Moves the GameObject from the supplied coordinate(s).

iTween.fadeTo(GameObject, Hashtable)

* Valid arguments: alpha:float, time:float, delay:float, transition:String, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »linear »
* Fades the material of the GameObject to the supplied alpha.
* Only works if the GameObject’s material calculates transparency.

iTween.fadeFrom(GameObject, Hashtable)

* Valid arguments: alpha:float, time:float, delay:float, transition:String, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »linear »
* Fades the material of the GameObject from the supplied alpha.
* Only works if the GameObject’s material calculates transparency.

iTween.rotateTo(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, transition:String, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »easeInOutCubic »
* Rotates the GameObject to the supplied degree(s).
* Rotation direction is automatically decided based on shortest travel time.
* Does not work on GUIText, GUITexture and similar display objects that do not support rotation.

iTween.rotateFrom(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, transition:String, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »easeInOutCubic »
* Rotates the GameObject from the supplied degree(s).
* Rotation direction is automatically decided based on shortest travel time.
* Does not work on GUIText, GUITexture and similar display objects that do not support rotation.

iTween.rotateBy(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, transition:String, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »easeInOutCubic »
* Rotates the GameObject 360 degrees times the supplied multiplier(s).
* Negative/positive values dictate direction of rotation.
* Does not work on GUIText, GUITexture and similar display objects that do not support rotation.

iTween.shake(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0
* Randomly shakes the GameObject on each supplied axis by the supplied magnitude.
* Negative/positive values dictate direction of initial impact.
* Application will gradually resolve and return object to its original coordinates.
* Does not utilize a transition.

iTween.stab(GameObject, Hashtable)

* Valid arguments: volume:float, pitch:float, clip:AudioClip, delay:float, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0
* Plays an AudioClip one time based on supplied volume and pitch.
* « onComplete » functionality fires after audio has finished playing.
* If an AudioSource component isn’t attached to the GameObject one will be automatically added.
* If no AudioClip is provided the default AudioSource’s clip property will be used.

iTween.scaleTo(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »easeInOutCubic »
* Scales the GameObject to the supplied multiplier(s).

iTween.scaleFrom(GameObject, Hashtable)

* Valid arguments: x:float, y:float, z:float, time:float, delay:float, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »easeInOutCubic »
* Scales the GameObject from the supplied multiplier(s).

iTween.audioTo(GameObject, Hashtable)

* Valid arguments: volume:float, pitch:float, delay:float, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »linear »
* Fades volume and or pitch of an AudioClip to the supplied target values.

iTween.audioFrom(GameObject, Hashtable)

* Valid arguments: volume:float, pitch:float, delay:float, onComplete:string, onCompleteParams:object
* Default arguments: time:1, delay:0, transition: »linear »
* Fades volume and or pitch of an AudioClip from the supplied target values.

iTween.stop(GameObject)

* Stops all iTweens on the supplied GameObject.

iTween.stopType(GameObject, String)

* Stops all iTweens on the supplied GameObject of a particular method.
* Supplied types are of the root name of the type (i.e. « move », « scale », « fade », etc…) minus the « To » or « From ».

iTween.tweenCount()

* Returns an int.
* Returns the total number of iTweens on the supplied GameObject.

De plus, sont intégrés les habituels « ease » permettant de donner des effets de mouvement.

avatar

krys64

bla bla bla

Vous aimerez aussi...

3 réponses

  1. avatar Mathieu dit :

    J’aimerais bien comparer les perfs de cette librairie à AniMate.
    En tout cas c’est vraiment un soulagement de voir une nouvelle librairie de easing arriver maintenant.

  2. avatar Bob Berkebile dit :

    Just wanted to let you know that the C# version is out now and the JavaScript version has gone through some updates! Thanks!!!!!

  3. avatar Arnaud dit :

    Je viens de tester iTween (version JS) et franchement, je suis bluffé par la facilité d’utilisation de l’API. C’est bien conçu !

    Les différentes transitions sur les mouvements sont extra et amènent pas mal de réalisme dans les animations !

    Le problème … je commence à en mettre partout 😀

    Je n’ai pas fait de comparatif JS vs CS sur cette librairie ; y a t’il des différences notables ? Performance ? Fonctionnalités ?

    En tout cas, merci pour l’info 🙂

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.