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
Download the Unity package manager in the release section.
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);
}Component is still under development with some feature such as blocking raycast after clicking to be added.
The asset creators below retain all rights to their assets.
- Lean Tween by dentedpixel