Что я сдал

This commit is contained in:
ThomasCharester committed 2026-05-04 22:36:24 +03:00
1 parent 24b1157026
commit a5665f0101
2838 files changed
+129953 -1304

No files matched your search

+24
View File
@@ -1,5 +1,8 @@
using System;
using Code.Audio;
using Code.GameplayServices;
using LitMotion;
using LitMotion.Extensions;
using UnityEngine;
namespace Code.PassingObjects
@@ -7,11 +10,32 @@ namespace Code.PassingObjects
public class Coin : PassingObject
{
[SerializeField] private int countOnActivate;
private MotionHandle _movementAnim;
private MotionHandle _rotationAnim;
private void OnTriggerEnter(Collider other)
{
PlayerScoreService.Instance.AddScore(countOnActivate);
AudioManager.Instance.PlayCoin();
PassingObjectsManager.Instance.KillChild(this);
}
private void Start()
{
_rotationAnim = LMotion.Create(Quaternion.Euler(0,0,0), Quaternion.Euler(0,180,0), 2)
.WithLoops(123)
.BindToRotation(transform);
_movementAnim = LMotion.Create(0.5f, 1.5f, 2)
.WithLoops(123, LoopType.Yoyo)
.BindToPositionY(transform);
}
private void OnDestroy()
{
_rotationAnim.Cancel();
_movementAnim.Cancel();
}
}
}