2026-01-05 13:34:57 +05:30
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class TimerSystem
|
|
|
|
|
{
|
|
|
|
|
private float timer = 10f;
|
|
|
|
|
private float timerIncrement = 5f;
|
|
|
|
|
|
|
|
|
|
public float Timer => timer;
|
|
|
|
|
|
|
|
|
|
public float TimerIncrement = 5f;
|
|
|
|
|
|
|
|
|
|
public TimerSystem()
|
|
|
|
|
{
|
2026-01-05 19:59:43 +05:30
|
|
|
CarController.OnCheckpointReached += UpdateTimer;
|
2026-01-05 13:34:57 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void IncreaseTimer()
|
|
|
|
|
{
|
|
|
|
|
timer += timerIncrement;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateTimer(float remTime)
|
|
|
|
|
{
|
|
|
|
|
timer = remTime;
|
|
|
|
|
IncreaseTimer();
|
|
|
|
|
}
|
|
|
|
|
}
|