DevKit is a component and API game development toolkit.
The goal of the asset is to provide stable, reusable boiler-plate code and component building blocks that developers can plug into their project (and extend if desired).
A variety of animation and transform-manipulation components are included. The components are built on top of an extensible programmatic API (full source code included!)
The asset's over 100 prefabs, along with a simple character controller, are used in the provided example scenes to demonstrate DevKit's components. The average polygon count per-model is 150.
DevKit animation API allows for convenient animation of
Renderer components via C# extension methods.
Out-of-the-box, the animation API can be used to move, scale, rotate, resize (for RectTransforms), and recolor (for Renderers) with a few simple lines of code.
To get started, be sure to import the
The animation API uses a builder pattern to animate a
1 2 3
Or using the fluent style:
1 2 3
Method calls can be chained together:
1 2 3 4 5
An action can be called in the builder's run method.
For example, to set the
GameObject to inactive (or some other operation):
1 2 3
Tweens can be executed in a sequence by passing a
boolean to the
1 2 3 4
A third parameter combination exists for the
Run method that allows for sequential tweens and a callback function when the animation completes:
1 2 3 4
Also available are shortcuts to move, scale, and rotate a
Transform if the builder pattern is not desirable:
1 2 3 4
In addition to the
Transform tween options. For example, a UI component can be rotated like a regular
Note that resizing is a separate operation from scaling for a
Inside of a custom UI component, the
Transform can be accessed as a
Renderer component has
Material, the color and alpha can be animated:
1 2 3 4
Note that the
Material must have a its
Rendering Mode set to
Transparent for the alpha transition have an effect.
The builder pattern is optional for these operations:
A custom animation duration and ease can be used in all of the animation API operations.
The amount of time of the animation's transition can be customized by supplying the
Tween builder method with a custom duration:
1 2 3 4 5 6
Be sure to import the ease namespace when specifying an Ease:
An ease has a
EaseFunctionType and an
Linear, but there are many ease functions to choose from.
|Ease Function Type||Description|
|Linear||Transition at a constant speed.|
|Quadratic||Transition at a polynomial rate of x2.|
|Cubic||Transition at a polynomial rate of x3.|
|Quartic||Transition at a polynomial rate of x3.|
|Quintic||Transition at a polynomial rate of x5.|
|Sine||Transition at the rate of a sine wave's curve.|
|Back||Transition back beyond the start value before continuing to the target value.|
|Bounce||Transition as if the value is bouncing like a ball hitting the ground.|
|Circular||Transition symmetrically in and out at the rate of a quarter circle.|
|Elastic||Transition in a "stretchy" fashion.|
|Exponential||This transition is effectively a combination of the Quartic and Quintic functions.|
|Ease Direction Type||Description|
|In||Apply the ease function at the start of the transition.|
|Out||Apply the ease function at the end of the transition.|
|InOut||Apply the ease function at the start and end of the transition.|
|OutIn||Apply the inverted ease function at the start and end of the transition.|
Creating an ease is simple:
The ease can be supplied either to the builder (making it the default ease for all of the builder's tweens):
1 2 3
Alternatively, the ease can be supplied to the individual tween method calls, making it apply only to a specific tween:
The DevKit animation components are build using the animation API .
|Animate Base||The core animation component which other animation components extend.|
|Animation Settings||Contains properties that define a set of animations used to configure other components.|
|Follow||This component moves a
|Move Point To Point||Moves a
|On Collision → Animate||Animates a
|On Collision → Move To||Moves a
|Recolor Randomly||Randomly changes the color of a
|Rotate Perpetually||Continually rotates a
The component can provide a simple one-off animation.
Or a series of animations.
This is an abstract component that other animation components inherit.
It cannot be added directly to a
1 2 3
The component provides an extensible base implementation that other animation components use to accomplish specific animation effects.
The component is used to visually configure an animation.
Certain other components, such as the
Animate component, use this component to define which animations they run.
This component moves a
GameObject along the
z dimensions of another
|Animation Type Option||Description|
|Smooth||Smooths the follow motion using Unity's Vector3.SmoothDamp function - useful for a follow camera.|
|One To One||Lock the position of the following
Move Point To Point#
The component moves the animated
GameObject from one location to another location.
On Collision → Animate#
The component is used to apply animation configuration from an
to the animated
AnimationSettings can either come from the colliding
GameObject (if it has an
...or be explicitly set in the inspector.
On Collision → Move To#
The component moves the component's
GameObject toward the
GameObject it collided with.
Colliding objects are filterable by their tag.
The component changes the color of a material to another random color. This component is mainly for to demonstrate how to animate a color change.
The component simply rotates a
|On Collision → Apply Transform||Apply a
|On Collision → Set Parent||Set the parent
On Collision → Apply Transform#
This component sets the colliding
Transform to the specified
Transform's position, scale, and rotation.
This is useful for "teleporting" a
GameObject, e.g. when a player's character falls to its death.
On Collision → Set Parent#
This component simply sets the colliding
This is useful for implementing moving platforms that allow the player to move with the platform.
|Character||Animate a bare-bones character - useful for simple prototypes/demonstrations.|
|Coroutine Proxy||Useful for running coroutines outside of Unity components.|
|On Collision → Destroy||Destroy a
|Subject Base||An abstract component that adds a simple, reusable mechanism for selecting a
This component allows a player to control an animated humanoid character model. The simple implementation of running and jumping is suitable for prototypes, demonstrations, testing, and simple platformer games.
This component is used extensively by the
DevKit animation API.
It should only ever be attached to a
GameObject programmatically and for the specific use-case where coroutines need to be run outside of a
On Collision → Destroy#
This component simply destroys a
GameObject when a collision occurs.
This is an abstract component that other components extend.
It provides a way to reference a
GameObject other than the one a derived component is attached to.
This adds flexibility when creating components found in
DevKit and custom components that depend on
Subject renders as a dropdown in the inspector with a set of options that defines which
GameObject is referenced.
|Game Object||An explicitly specified
|Player||The first available
SubjectBase component is as easy as extending a custom component class with it:
1 2 3
This produces a custom component with a single
Though helpful, the base class is not necessary to use a
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Subject in the
GameObject via the
It is also possible to get components in a variety of ways from the
similar to how components are retrieved in
A third way, unique to
DevKit, is available that gets OR adds a component if does not exist on the
1 2 3 4 5 6 7 8 9 10 11 12
Subject can be programmatically switched:
1 2 3 4