brunomikoski / Animation-Sequencer

A visual tool that allows you to create animated sequences of tweens and tweak them on editor time.
MIT License
960 stars 116 forks source link

Animation Sequencer

GitHub license

GitHub issues GitHub pull requests GitHub last commit

GitHub followers Twitter Follow

I LOVE Tween, I love DOTween even more! But having to wait for a recompilation every time you tweak a single value on some animation it's frustrating! Even more complicated is properly have to visualize the entire animation in your head and having to wait until you reach your animation to see what you have done! That's why I created the Animation Sequencer, it is (cloned) HEAVILY INSPIRED from Space Ape amazing Creative Engineering: Balancing & Juicing with Animations presentation.

This is still in heavy development, please use it carefully

Example Example

Features

Built in Steps

How to use?

FAQ

I'm seeing a bunch of errors like `error CS1929: 'CanvasGroup' does not contain a definition for 'DOFade'` This means that you don't have the DOTween setup complete with Asmdef files, make sure you do it by the menu: `Tools/Demigiant/DOTween Utility Panel`
How can I create my custom actions? To create a custom action there's a few things you need to do, first your class needs to be `[Serializable]` in order to be properly displayed on inspector. Now you need to make sure whatever you are doing, you are connecting it with the Sequence, like the example bellow. Also notice that in this case I'm adding the Duration its getting the lenght from the clip ```c# [Serializable] public class PlayLegacyAnimation : AnimationStepBase { public override string DisplayName => "Play Legacy Animation"; [SerializeField] private Animation animation; public override void AddTweenToSequence(Sequence animationSequence) { animationSequence.AppendInterval(Delay); animationSequence.AppendCallback( () => { animation.Play(); } ); animationSequence.AppendInterval(animation.clip.length); } } ```
I have my own DOTween extensions, can I use that? Absolutely! The same as the step, you can add any new DOTween action by extending `DOTweenActionBase`. In order to avoid any performance issues all the tweens are created on the PrepareToPlay method on Awake, and are paused. ```c# [Serializable] public sealed class ChangeMaterialStrengthDOTweenAction : DOTweenActionBase { public override string DisplayName => "Change Material Strength"; public override Type TargetComponentType => typeof(Renderer); [SerializeField, Range(0,1)] private float materialStrength = 1; public override bool CreateTween(GameObject target, float duration, int loops, LoopType loopType) { Renderer renderer = target.GetComponent(); if (renderer == null) return false; TweenerCore materialTween = renderer.sharedMaterial.DOFloat(materialStrength, "Strength", duration); SetTween(materialTween, loops, loopType); return true; } } ``` ![custom-tween-action](https://user-images.githubusercontent.com/600419/109774425-3965a280-7bf8-11eb-9bfe-90b0be8b8617.gif)
Using custom animation curve as easing You can use the Custom ease to define an *AnimationCurve* for the Tween. ![custom-ease](https://user-images.githubusercontent.com/600419/109780020-7af94c00-7bfe-11eb-8f0f-52480dd97ea3.gif)
What are the differences between the initialization settings - None *Don't do anything on the AnimationSequencer Awake method* - PrepareToPlayOnAwake *This will make sure the Tweens that are from are prepared to play at the intial value on Awake.* - PlayOnAwake Will play the tween on Awake.*

System Requirements

Unity 2018.4.0 or later versions

How to install

Add from OpenUPM | via scoped registry, recommended This package is available on OpenUPM: https://openupm.com/packages/com.brunomikoski.animationsequencer To add it the package to your project: - open `Edit/Project Settings/Package Manager` - add a new Scoped Registry: ``` Name: OpenUPM URL: https://package.openupm.com/ Scope(s): com.brunomikoski com.demigiant ``` - click Save - open Package Manager - click + - select Add from Git URL - paste `com.brunomikoski.animationsequencer` - click Add
Add from GitHub | not recommended, no updates :( You can also add it directly from GitHub on Unity 2019.4+. Note that you won't be able to receive updates through Package Manager this way, you'll have to update manually. - open Package Manager - click + - select Add from Git URL - paste `https://github.com/brunomikoski/Animation-Sequencer.git` - click Add