Skip to content

3. Tweening Custom Properties

prime31 edited this page Apr 26, 2012 · 2 revisions

GoKit lets you tween any property on any object that is of type Color, float, int, Vector2, Vector3 (including x, y and z), Vector3 paths or Vector4. If that isn't enough you can always add generic property tween types to fit your needs. Tweening a custom property is very similar to using the built-in Tweens. Below is an example of tweening a Vector2 property on a custom class.

public class MyClass
{
	public Vector2 myVector { get; set; }
}

Go.to( instanceOfMyClass, 3f, new TweenConfig().vector2Prop( "myVector", new Vector2( 3, 5 ) ) );