30 lines
722 B
C#
30 lines
722 B
C#
using System;
|
|
using System.Collections;
|
|
using DG.Tweening;
|
|
using UnityEngine;
|
|
|
|
public class CoinCamera : MonoBehaviour
|
|
{
|
|
[SerializeField] private GameObject view = null;
|
|
|
|
private Sequence _animation;
|
|
|
|
private void Start()
|
|
{
|
|
_animation = DOTween.Sequence();
|
|
_animation.SetAutoKill(false);
|
|
_animation.Append(
|
|
view.transform.DORotate(Vector3.up * 360f, 0.6f, RotateMode.FastBeyond360)
|
|
);
|
|
_animation.Join(
|
|
view.transform.DOPunchScale(Vector3.one * 0.5f, 0.4f)
|
|
);
|
|
_animation.Complete();
|
|
}
|
|
|
|
[CustomButton("Rotate")]
|
|
public void RotateView()
|
|
{
|
|
_animation.Restart();
|
|
}
|
|
} |