void Update() { DisplayTime(); if (GlobalCountDown.TimeLeft.Seconds > 0) { lossText.SetActive(false); } // if timer hits 0 // show losstimer text // disable player movement if (GlobalCountDown.TimeLeft.Seconds <= 0) { lossText.SetActive(true); losstime -= Time.deltaTime; GameObject.Find("Pupple - Player").GetComponent <PlayerGridMovement>().enabled = false; // reset scene after delay if (losstime <= 0) { Debug.Log("reset"); GlobalCountDown.StartCountDown(System.TimeSpan.FromMinutes(2)); SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } } //Reset Function if (Input.GetKeyDown("r")) { SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); } }
void Start() { GlobalCountDown.StartCountDown(TimeSpan.FromSeconds(9)); //PlayerPrefs.SetInt("Level2", 0); if (unansweredQuestions == null || unansweredQuestions.Count == 0) { unansweredQuestions = questions.ToList <Question> (); } SetCurrentQuestion(); }
void Start() { GlobalCountDown.StartCountDown(TimeSpan.FromSeconds(12)); //set the amount of time that the player has to finish the level if (unansweredQuestions == null || unansweredQuestions.Count == 0) { unansweredQuestions = questions.ToList <Question>(); } SetCurrentQuestion(); }
//public string timeLeft = GlobalCountDown.FromSeconds.ToString("mm:ss"); //string timeLeft = GlobalCountDown.TimeLeft.TotalSeconds().ToString("D2"); void Start() { GlobalCountDown.StartCountDown(TimeSpan.FromSeconds(14)); //set the amount of time that the player has to finish the level //string timeLeft = GlobalCountDown.TimeLeft.TotalSeconds(8).ToString("D2"); PlayerPrefs.SetInt("Level2", 0); CheckCurrentLevel(); if (unansweredQuestions == null || unansweredQuestions.Count == 0) { unansweredQuestions = questions.ToList <Question> (); } SetCurrentQuestion(); }
// Start is called before the first frame update void Start() { Scene currentScene = SceneManager.GetActiveScene(); if (currentScene == SceneManager.GetSceneByName("OpeningHint")) { GlobalCountDown.StartCountDown(TimeSpan.FromMinutes(30)); } SaveTimeToFile(currentScene); //For testing //GlobalCountDown.StartCountDown(TimeSpan.FromSeconds(10)); }
// THIS SCRIPT GOES ON MAIN MENU CANVAS public void StartGame() { SceneManager.LoadScene(2); GlobalCountDown.StartCountDown(System.TimeSpan.FromMinutes(2)); }