Skip to content

junjie076/TweenAnimatedButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Unity Simple TweenAnimatedButton

Unity Simple TweenAnimatedButton is a small simple and quick to apply Unity button replacement component that comes with a simple tween animation. Suitable for quick prototype games that wants some button animation

Installation

Download the Unity package manager in the release section.

Usage

Just insert the TweenAnimatedButton.cs as a component to the button object. The button will have Unity Button function with simple tween animation

The button animation size can be adjusted here

private Vector3 scaleUpSize = new Vector3(1.03f, 1.03f, 1.03f);

The animation tween type can be adjusted in the LeanTween.scale function below. More information about LeanTween can be found here

    public override void OnPointerClick(PointerEventData eventData)
    {
        if (!IsActive() || !IsInteractable())
            return;

        //TODO: Find ways to block raycast before the tween is complete

        //Run the tween animation first before running the real onClick
        LeanTween.scale(this.gameObject, scaleUpSize, 0.3f).setEaseShake().setOnComplete(OnCompleteClickAnimation);
    }

Development

Component is still under development with some feature such as blocking raycast after clicking to be added.

Copyright and Licensing:

Third-Party Code Attribution:

The asset creators below retain all rights to their assets.

MIT

About

Simple and quick to apply animation for Unity buttons

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages