• Stars
    star
    156
  • Rank 232,034 (Top 5 %)
  • Language
    C#
  • Created about 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Tween library for Unity. The best of GoKit and GoKitLite combined in an easy to use API

ZestKit

The 3rd tween library for Unity. Yes, you read that number correctly. First there was GoKit. Then there was GoKitLite. They each had their purpose. GoKit was insanely customizable and GoKitLite was insanely fast. ZestKit was designed to take the best of both of them and make it even better. For a brief overview on the design and structure checkout this blog post. Be sure to checkout the wiki as well for usage examples.

Quick Start or I Just Wanna Tween

Import the files in the ZestKit folder into your project, add using Prime31.ZestKit to your file and you are ready to start tweening. Using the extension methods (currently covering 26+ methods for the Transform, Material, AudioSource, Camera, CanvasGroup, Image, RectTransform and ScrollRect classes) will get you up and running in no time. Note that all extension methods have the "ZK" prefix to avoid conflicts. Examples:

// tween position to Vector3.one over 0.3 seconds
transform.ZKpositionTo( Vector3.one, 0.3f ).start();

// tween eulerAngles to Vector3.zero over 0.3 seconds then ping-pong back to the original value
transform.ZKpositionTo( Vector3.zero, 0.3f )
    .setLoops( LoopType.PingPong )
    .start();

// tween the Material _Color property from black to yellow over 0.5 seconds
material.ZKcolorTo( Color.yellow, 0.5f )
    .setFrom( Color.black )
    .start();

// tween localScale independant of Time.timeScale with a 2 second delay before starting the tween
// and get notified when the tween has finished specifying the easing equation to use
transform.ZKlocalScaleTo( new Vector3( 10f, 10f, 10f ), 0.5f )
    .setDelay( 2f )
    .setIsTimeScaleIndependent()
    .setCompletionHandler( myCompletionHandlerFunction )
    .setEaseType( EaseType.ElasticOut )
    .start();

What Can I Tween?

Out of the box, ZestKit can tween any int, float, Vector2, Vector3, Vector4, Quaternion, Rect, Color, Color32 and it has a built in spline editor ("borrowed" from GoKit and expanded upon ;). ZestKit offers both strongly targeted and weakly targeted tweens. What's the difference between strongly and weakly targeted tweens? A strongly targeted tween is something ZestKit knows about out of the box. The most commonly used would be transform.position/rotation/scale, material.color, etc. A weakly targeted tween means ZestKit doesn't know about the object or property being tweened. For example, if you have a custom class (SomeCustomClass) that has a Vector3 property (myVector3) you can still tween this value with ZestKit by using a property tween. The following would do the trick:

PropertyTweens.vector3PropertyTo( someCustomClassInstance, "myVector3", Vector3.zero, Vector3.one, 0.4f )

What About Those Fancy Easing Equations?

ZestKit offers a bunch of built-in easing equations and it also lets you specify an AnimationCurve to handle easing for maximum flexibility. The included easing types are: Linear, SineIn, SineOut, SineInOut, QuadIn, QuadOut, QuadInOut, CubicIn, CubicOut, CubicInOut, QuartIn, QuartOut, QuartInOut, QuintIn, QuintOut, QuintInOut, ExpoIn, ExpoOut, ExpoInOut, CircIn, CircOut, CircInOut, ElasticIn, ElasticOut, ElasticInOut, Punch, BackIn, BackOut, BackInOut, BounceIn, BounceOut and BounceInOut.

Extending ZestKit or Using the Tween Engine Without ZestKit

Special care was taken when making ZestKit so that it can be extended with great ease. Let's take the PropertyTween example from above and make it a proper ZestKit tween so that we don't have to use the PropertyTween class (it allocates a bit of memory to locate the property). All we have to do is implement the ITweenTarget<T> interface which contains a single method:

public class SomeCustomClass : ITweenTarget<Vector3>
{
  public void setTweenedValue( Vector3 value )
  {
      myVector3 = value;
  }
}

That's it. SomeCustomClass is now a valid ITweenTarget<T> and it can tweened with a Vector3Tween (just pass it as the first parameter to the constructor or the initialize method of the Vector3Tween).

It was mentioned above that you can use the ZestKit tween engine without ZestKit. The Zest class contains the core tween engine and all of its easing powers ready to use. If you are going that route, it is expected that you are a big girl/boy and can read the code and figure out how to use it so you're on your own from here.

License

Attribution-NonCommercial-ShareAlike 3.0 Unported with simple explanation with the attribution clause waived. You are free to use ZestKit in any and all games that you make. You cannot sell ZestKit directly or as part of a larger game asset.

More Repositories

1

Nez

Nez is a free 2D focused framework that works with MonoGame and FNA
C#
1,721
star
2

CharacterController2D

C#
1,032
star
3

TouchKit

Gestures and input handling made sane for Unity
C#
896
star
4

GoKit

Lightweight tween library for Unity
C#
582
star
5

RecyclerKit

Object pool manager for Unity
C#
363
star
6

TransitionKit

Modular, extensible transitions in scene and between scenes
C#
300
star
7

SpriteLightKit

Blended lighting system for Unity that works with standard Sprites
C#
227
star
8

StateKit

Dead simple, lightweight "states as objects" system
C#
220
star
9

zig-ecs

Zig
144
star
10

P31UnityAddOns

Mostly defunct. Features were added and components broken out in the *Kit repositories.
C#
142
star
11

Nez-Samples

Samples and demos of various Nez features
C#
138
star
12

zig-upaya

Zig-based framework for creating game tools and helper apps
Zig
124
star
13

MessageKit

Decoupled message sending system meant as a replacement for SendMessage and its variants.
C#
122
star
14

zig-gamekit

Companion repo for zig-renderkit for making 2D games
Zig
103
star
15

CameraKit2D

Framework for creating 2D camera systems
C#
95
star
16

zig-renderkit

Zig
54
star
17

zig-flecs

C
51
star
18

GoKitLite

A super duper lightweight tweening library for Unity
C#
51
star
19

SoundKit

C#
45
star
20

Unity-Ripgrep-Search-Tool

C#
42
star
21

P31TaskManager

General purpose task manager that provides a lot more control and power than a standard coroutine
C#
35
star
22

via

V 2D game library
V
29
star
23

UnityCgShaderTutorials

Source code for the Unity Cg Shaders tutorial series on YouTube: http://www.youtube.com/playlist?list=PLb8LPjN5zpx1tauZfNE1cMIIPy15UlJNZ
C#
27
star
24

V-C-Wrapper-Generator

Helper for generating Odin and V wrapper code from C source
C#
19
star
25

Simple-ECS-Sharp

C#
18
star
26

ecs-lua

A simple, hybrid ECS
Lua
17
star
27

zig-miniaudio

Zig
17
star
28

SpriteKit

DEFUNCT: Unity now has 2D tools built in. This is now not maintained.
C#
15
star
29

PaletteKit

Helpful editor classes for importing and displaying color palettes
JavaScript
12
star
30

LearningUnits

C#
10
star
31

Odin-Sublime-Text-Plugin

Python
9
star
32

ImGuiGL-Renderer

C#
9
star
33

zig-vulkan

C++
5
star
34

egui_curve_tool

Rust
4
star
35

zig-aya

Zig
4
star
36

App-Engine-Task-Manager

Python
3
star
37

Odin-Libs

C
3
star
38

v-temp-modules

V
3
star
39

zig-fmod

Zig
2
star
40

Hugo-Helper

macOS app for managing a Hugo website
C#
2
star
41

prime31.github.io

HTML
2
star
42

fips-flecs

fipsified version of the Flecs ECS
CMake
1
star