Home

Awesome

Logo

<h1 align="center">AnimationUI</h1>

AnimationUI is a unity tool to create UI animation easily with no code. You can simply drag and drop to create some smooth UI animation. There are some option that you can set such as the easing, duration, etc. It basically consist of a component that has an array of sequence that has an array of task. This may be special for UI, but it's also possible to animate values for non UI component like transform. You can also make a custom sequence for non UI component with UnityEvent including the dynamic one. Adding function to call at certain time or at the end of animation is also possible with code.

🕹ī¸ Demo Preview

<p align="center" width="100%"> <img width="49%" src="./Images/PreviewAnimationUI.gif"> <img width="49%" src="./Images/PreviewSettings.gif"> </p> <p align="center" width="100%"> <img width="49%" src="./Images/PreviewUpgrade.gif"> <img width="49%" src="./Images/PreviewStart.gif"> </p>

✨ Features

📘 Instruction

Instruction 1

Instruction 2

Instruction 3

Instruction 4

Instruction 5

Instruction 6

Instruction 7

🔍 API Reference

Get the reference by

using DhafinFawwaz.AnimationUILib;

public class Something : MonoBehaviour
{
    AnimationUI _animationUI;
    void DoSomething()
    {
        _animationUI.Play();
    }
}

🔗 Syntax

MethodsDescription
Play()Play the animation
PlayReversed()Play the animation but reversed. Usefull to go back from a certain menu quickly.
AddFunctionAt(float time, Action func)Add a function to be called at a certain time after the AnimationUI.Play() is called
Member PropertiesTypeDescription
OnAnimationEndedActionCallback when the latest wait sequence is finished. It's intended like this so that you also have an option for this case and not just at the very end of the whole sequences. If you want to make it get called at the end of the whole sequences, you can either call AddFunctionAt(_animationUI.TotalDuration, func) or just add another wait sequence as the last sequence in the inspector
Static PropertiesTypeDescription
OnSetActiveAllInputAction<bool>Play the animation
OnSetActiveAllInputAction<bool>Play the animation
OnPlaySoundByFileAction<AudioClip>Play the animation but reversed.
OnPlaySoundByIndexAction<int>Play the animation but reversed.

There's still no proper way to disable all input so if you also want to disable input other than mouse and touch, please modify AnimationUICustomizable.cs. You can also subscribe the static event of AnimationUI which are OnSetActiveAllInput, OnPlaySoundByFile, or OnPlaySoundByIndex to change its behaviour. Example of how to achieve this is in the Demo folder which is AudioManager.cs. Most of the variable in the Sequence class is modifiedable, so it's possible to change the values of _animationUI.AnimationSequence[MyIndex].MyVariableName on runtime.

📖 Examples

Play the animation, call LoadSceneWithLoadingBar() after animation finished.

_animationUI.OnAnimationEnded += LoadSceneWithLoadingBar;
_animationUI.Play();

Subscribe to customizable AnimationUI events.

void OnEnable()
{
    AnimationUI.OnSetActiveAllInput += SetActiveAllInput
    AnimationUI.OnPlaySoundByFile += PlaySoundByFile
    AnimationUI.OnPlaySoundByIndex += PlaySoundByIndex
}
void OnDisable()
{
    AnimationUI.OnSetActiveAllInput -= SetActiveAllInput
    AnimationUI.OnPlaySoundByFile -= PlaySoundByFile
    AnimationUI.OnPlaySoundByIndex -= PlaySoundByIndex
}
void SetActiveAllInput(bool isActive)
{
    Debug.Log("SetActive");
}
void PlaySoundByFile(AudioClip clip)
{
    Debug.Log("Playing " + clip.name);
}
void PlaySoundByIndex(int index)
{
    Debug.Log("Playing clip at index " + index.ToString());
}

📃 Note

📝 License

MIT