Initial commit
This commit is contained in:
55
Assets/Scripts/FlowController.cs
Normal file
55
Assets/Scripts/FlowController.cs
Normal file
@ -0,0 +1,55 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class FlowController : MonoBehaviour
|
||||
{
|
||||
public GameObject canvasTutorial;
|
||||
public GameObject canvasListBarang;
|
||||
public GameObject canvasEvakuasi;
|
||||
public GameObject canvasInfoJalur;
|
||||
public GameObject canvasSlideAkhir;
|
||||
public GameObject mencaripath;
|
||||
public GameObject canvasGempa;
|
||||
|
||||
public PlayerBergerak1 kontrolPlayer;
|
||||
|
||||
void Start()
|
||||
{
|
||||
// Awal hanya canvasTutorial yang aktif
|
||||
canvasTutorial.SetActive(true);
|
||||
canvasListBarang.SetActive(false);
|
||||
canvasEvakuasi.SetActive(false);
|
||||
canvasInfoJalur.SetActive(false);
|
||||
|
||||
if (kontrolPlayer != null)
|
||||
kontrolPlayer.Gerak = false;
|
||||
}
|
||||
|
||||
public void SelesaiTutorial()
|
||||
{
|
||||
canvasTutorial.SetActive(false);
|
||||
canvasListBarang.SetActive(true);
|
||||
kontrolPlayer.Gerak = true;
|
||||
}
|
||||
|
||||
public void SelesaiBerlindung()
|
||||
{
|
||||
canvasGempa.SetActive(false);
|
||||
canvasEvakuasi.SetActive(true);
|
||||
kontrolPlayer.Gerak = true;
|
||||
}
|
||||
|
||||
public void SelesaiEvakuasi()
|
||||
{
|
||||
canvasEvakuasi.SetActive(false);
|
||||
canvasInfoJalur.SetActive(true);
|
||||
mencaripath.SetActive(true);
|
||||
canvasSlideAkhir.SetActive(true);
|
||||
}
|
||||
|
||||
public void KembaliKeMenu()
|
||||
{
|
||||
SceneManager.LoadScene("MainMenu");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user