how can i add 5 seconds to my timer on triggerenter 2D
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
public class Timer : MonoBehaviour {
// Use this for initialization
void Start()
{
//restartMenu.SetActive(false);
}
// Update is called once per frame
void Update()
{
timeLeft -= Time.deltaTime; // so basically this is subtracting float - TIME
timerText.text = "TimeLeft:" + Mathf.Floor(timeLeft / 60).ToString("00");
string minSec = string.Format("{0}:{1:00}", (int)timeLeft / 60, (int)timeLeft % 60); timerText.text = minSec;
if (timeLeft <= 0)
{
timeLeft = 0f;
enemySpawner.enabled = false; // So im turning off the enemy spawning when the timer reaches zero
}
}
public float timeLeft = 60f;
public Text timerText;
public InfinitePlatformGenerator enemySpawner;
}