added coins
This commit is contained in:
1 parent
4a8a8ae916
commit
9e5f46b48c
37 files changed
+7536
-79
No files matched your search
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
using PrimeTween;
|
||||
|
||||
namespace Code.Gameplay.Coin
|
||||
{
|
||||
public class Coin : MonoBehaviour
|
||||
{
|
||||
public Vector3 rotationAngle = new(0, 360, 0);
|
||||
public float rotationDuration = 10f;
|
||||
|
||||
public float amplitude = 0.5f;
|
||||
public float cycleDuration = 2f;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
Tween.LocalEulerAngles(transform,
|
||||
startValue: Vector3.zero,
|
||||
endValue: rotationAngle,
|
||||
duration: rotationDuration,
|
||||
cycles: -1,
|
||||
ease: Ease.Linear);
|
||||
|
||||
Tween.LocalPositionY(transform,
|
||||
endValue: transform.localPosition.y + amplitude,
|
||||
duration: cycleDuration / 2,
|
||||
cycles: -1,
|
||||
cycleMode: CycleMode.Yoyo,
|
||||
ease: Ease.InOutSine);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user