An error occurred while loading the file. Please try again.
-
Raffael Di Pietro authoredb3e8bfbf
Forked from
Chirz / CityEscape
127 commits behind the upstream repository.
loadScene.cs 1009 B
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class loadScene : MonoBehaviour
{
public string nextYear;
public Text year;
public Text city;
public string scene;
public Animator animmator;
public string nom;
public void ChargerScene()
{
animmator.SetBool("Change", true);
year.text = "" + nextYear;
city.text = nom;
StartCoroutine(nextLevelTimer());
}
private IEnumerator nextLevelTimer()
{
yield return new WaitForSeconds(5);
SceneManager.LoadScene(scene);
}
void Start()
{
}
// Update is called once per frame
void Update()
{
if(PlayerNature.instance.currentNature <= 0)
{
ChargerScene();
PlayerNature.instance.currentNature = 100;
}
}
public void ExitGame()
{
Application.Quit();
}
}