TimeStop.cs 558 B
using UnityEngine;
/*
https://gamedevbeginner.com/the-right-way-to-pause-the-game-in-unity/#:~:text=The%20most%20convenient%20method%20for%20pausing%20the%20game,will%20return%20the%20game%20to%20its%20normal%20speed.
*/
public class TimeStop : MonoBehaviour
{
public bool checkTimeToStop;
void Start()
{
PauseGame();
}
private void Update()
{
if (checkTimeToStop == true)
PauseGame();
}
private void PauseGame()
{
UIconfig.GamePaused = true;
Time.timeScale = 0;
}
}