added speed change and death
This commit is contained in:
1 parent
9e5f46b48c
commit
08e050ffd3
6 files changed
+1437
-5
No files matched your search
@@ -0,0 +1,33 @@
|
||||
using UnityEngine;
|
||||
using Code.Gameplay.Player;
|
||||
|
||||
namespace Code.Gameplay.Management
|
||||
{
|
||||
public class GameSpeedManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private PlayerController playerController;
|
||||
[SerializeField] private float speedMultiplier = 1.2f;
|
||||
[SerializeField] private float timeInterval = 10f;
|
||||
|
||||
private float _timer;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
_timer += Time.deltaTime;
|
||||
|
||||
if (_timer >= timeInterval)
|
||||
{
|
||||
AccelerateGame();
|
||||
_timer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void AccelerateGame()
|
||||
{
|
||||
if (playerController)
|
||||
{
|
||||
playerController.IncreaseSpeed(speedMultiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b5f84b26f43465ab2930bb64735922d
|
||||
timeCreated: 1772914590
|
||||
Reference in new issue
Block a user