Hello everyone. I’m trying to make the game freeze from start using time. Show the information for player to read then player can click button “Ok” to start the game. But game still freeze after button “Ok” is pressed. Thanks for anyone who help me. Here is my code.
using UnityEngine;
using System.Collections;
public class MissionPause : MonoBehaviour
{
public Canvas missionCanvas;
bool missionPanel = true;
public float Timer = 3f;
void Start ()
{
Timer = Time.time + Timer;
}
void Update ()
{
if (Timer < Time.time)
{
Time.timeScale = 0;
}
}
public void ResumeGame()
{
if (missionPanel == true)
{
missionPanel = false;
missionCanvas.enabled = false;
Time.timeScale = 1 ;
}
}
}