Awesome
<h1 align="center">Unity UI Playables</h1>[!WARNING] From several perspectives, I recommend controlling UI animations with keyframes rather than clips. For reference, see this link:
https://forum.unity.com/threads/animation-events-on-last-frame-arent-fired-in-timeline-when-its-the-last-frame-of-the-timeline.791258/.Therefore, this repository will be archived. When controlling the Timeline with keyframes, I strongly recommend using the following assets:
https://assetstore.unity.com/packages/tools/animation/curvify-277062.
Tracks and Clips for controlling the Unity UI (uGUI) with Timeline.
<p align="center"> <img width="80%" src="https://user-images.githubusercontent.com/47441314/113313016-cf9afe80-9345-11eb-9aa9-422c53b5a3f8.gif" alt="Demo"> </p>Features
Control Unity UI (uGUI)
Unity UI Playables allows you to control any uGUI components and its parameters with Timeline.
<p align="center"> <img width="80%" src="https://user-images.githubusercontent.com/47441314/113312392-34098e00-9345-11eb-9ec4-614caffe09a0.png" alt="Control Unity UI"> </p>Easings and Animation Curve
You can easily set up animations using the easing functions.
If you want to create complex animations, you can also use Animation Curve.
Looping of animations is also possible (Repeat, Reverse, and PingPong are supported as loop types).
Blending
All clips and all parameters are blendable.
<p align="center"> <img width="80%" src="https://user-images.githubusercontent.com/47441314/113312482-4c79a880-9345-11eb-8e19-c6c85d2e1338.png" alt="Blending"> </p>Setup
Requirement
Unity 2019.4 or higher.
Install
- Open the Package Manager from Window > Package Manager
- "+" button > Add package from git URL
- Enter the following
Or, open Packages/manifest.json and add the following to the dependencies block.
{
"dependencies": {
"com.harumak.unityuiplayables": "https://github.com/Haruma-K/UnityUIPlayables.git?path=/Assets/UnityUIPlayables"
}
}
If you want to set the target version, specify it like follow.
License
This software is released under the MIT License.
You are free to use it within the scope of the license.
However, the following copyright and license notices are required for use.
Usage
Create Tracks and Clips
Press the add track button in Timeline and select the track below UnityUIPlayables.
<p align="center"> <img width=500 src="https://user-images.githubusercontent.com/47441314/113312977-c6aa2d00-9345-11eb-99f5-cd46b718c708.png" alt="Create Tracks and Clips"> </p>Next, add the corresponding clip to the track.
The parameters can be controlled from the clip's inspector.
Controllable Parameters
Component Name | Parameter Name |
---|---|
<b>RectTransform</b> | Anchored Position<br>Size Delta<br>Local Rotation<br>Local Scale |
<b>Graphic</b> | Color |
<b>Image</b> | Color<br>Fill Amount |
<b>RawImage</b> | Color<br>UV Rect |
<b>Text</b> | Color<br>Font Size<br>Line Spacing |
<b>Text (Text Mesh Pro)</b> | Font Size<br>Color<br>Gradient (Top Left / Top Right / Bottom Left / Bottom Right)<br>Spacing (Character / Line / Word / Paragraph)<br>Face Color (Only at Runtime)<br>Outline Color (Only at Runtime)<br>Outline Width (Only at Runtime) |
<b>Slider</b> | Value |
<b>Canvas Group</b> | Alpha |
Demo
- Clone this repository.
- Open and play the following scene.