Что я сдал

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();
}
}
}
+39
View File
@@ -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();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 633c0357f80e4e53a0fc9410a2a40405
timeCreated: 1777906076
@@ -0,0 +1,39 @@
using Code.Audio;
using Code.GameplayServices;
using LitMotion;
using LitMotion.Extensions;
using UnityEngine;
namespace Code.PassingObjects
{
public class InvincibilityPowerUp : PassingObject
{
private MotionHandle _movementAnim;
private MotionHandle _rotationAnim;
private void OnTriggerEnter(Collider other)
{
BonusService.Instance.GiveInvincibility().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();
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1f29fbb59e114a04a60fb0fd883b70c1
timeCreated: 1777907203
+5 -1
View File
@@ -5,6 +5,10 @@ namespace Code.PassingObjects
{
public class Wall : PassingObject
{
private void OnTriggerEnter(Collider other) => GameplayManager.Instance.PlayerDead();
private void OnTriggerEnter(Collider other)
{
if (!BonusService.Instance.Invincibility) GameplayManager.Instance.PlayerDied();
}
}
}