AK056/Assets/Plugins/PrimeTween/Demo/Scripts/SqueezeAnimation.cs
2025-05-08 13:38:55 +08:00

20 lines
495 B
C#

#if PRIME_TWEEN_INSTALLED
using PrimeTween;
using UnityEngine;
namespace PrimeTweenDemo {
public class SqueezeAnimation : Clickable {
[SerializeField] Transform target;
Tween tween;
public override void OnClick() => PlayAnimation();
public void PlayAnimation() {
if (!tween.isAlive) {
tween = Tween.Scale(target, new Vector3(1.15f, 0.9f, 1.15f), 0.2f, Ease.OutSine, 2, CycleMode.Yoyo);
}
}
}
}
#endif