Что я сдал
This commit is contained in:
1 parent
24b1157026
commit
a5665f0101
2838 files changed
+129953
-1304
No files matched your search
@@ -0,0 +1,39 @@
|
||||
using Code.Audio;
|
||||
using Code.GameplayServices;
|
||||
using LitMotion;
|
||||
using LitMotion.Extensions;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.PassingObjects
|
||||
{
|
||||
public class CoinBooster : PassingObject
|
||||
{
|
||||
private MotionHandle _movementAnim;
|
||||
private MotionHandle _rotationAnim;
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
BonusService.Instance.GiveCoinBoost().Forget();
|
||||
AudioManager.Instance.PlayPowerUp();
|
||||
|
||||
PassingObjectsManager.Instance.KillChild(this);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_rotationAnim = LMotion.Create(Quaternion.Euler(0,0,0), Quaternion.Euler(0,180,0), 1)
|
||||
.WithLoops(123)
|
||||
.BindToRotation(transform);
|
||||
|
||||
_movementAnim = LMotion.Create(0.5f, 1.5f, 1)
|
||||
.WithLoops(123, LoopType.Yoyo)
|
||||
.BindToPositionY(transform);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
_rotationAnim.Cancel();
|
||||
_movementAnim.Cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user