Hello guys.
In my game, has a start menu with a variable called refresh and it’s value is decreased every frame while the scene is active, until this ok. In game, player can return to menu with pause, but when he returns the var refresh isn’t being decreased, it is “locked” at inicial value. Why is this occurring? I am loading scene normally with SceneManager and decreasing in Update.
Thanks!
OBS: The void ‘load’ is the function called when player clicks on ‘new game’ button, the var ‘clicou’ is being true normally, but var refresh is not being decreased
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
public class TrocaDeCena : MonoBehaviour
{
private float refresh = 5f;
private bool clicou = false;
// Use this for initialization
void Start ()
{
refresh = 5f;
}
// Update is called once per frame
void Update()
{
if (clicou) {
refresh -= Time.deltaTime;
if (refresh <= 0) {
SceneManager.LoadScene ("general-ravana");
}
}
}
public void load()
{
if (clicou == false) {
clicou = true;
}
}
}