19 lines
504 B
C#
19 lines
504 B
C#
|
|
using PrimeTween;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace PrimeTweenDemo
|
||
|
|
{
|
||
|
|
public class TestAnimation:MonoBehaviour
|
||
|
|
{
|
||
|
|
[SerializeField] Transform animationAnchor;
|
||
|
|
public bool _isClosed;
|
||
|
|
|
||
|
|
[Sirenix.OdinInspector.Button("Test")]
|
||
|
|
public void Test()
|
||
|
|
{
|
||
|
|
var rotationTween = Tween.LocalRotation(animationAnchor, _isClosed ? new Vector3(0, -90) : Vector3.zero, 0.7f, Ease.InOutElastic);
|
||
|
|
var sequence = Sequence.Create(rotationTween);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|