54 lines
1013 B
C#
54 lines
1013 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
|
|
public class CanvasTransisi : MonoBehaviour
|
|
{
|
|
public bool IsTransisi, IsTidakPerlu;
|
|
|
|
public static string NamaScene;
|
|
|
|
private void Awake()
|
|
{
|
|
if (IsTransisi && IsTidakPerlu)
|
|
{
|
|
gameObject.SetActive(false);
|
|
}
|
|
}
|
|
|
|
public void btn_Suara(int id)
|
|
{
|
|
KumpulanSuara.instance.Panggil_Sfx(0);
|
|
}
|
|
|
|
public void btn_pindah(string nama)
|
|
{
|
|
this.gameObject.SetActive(true);
|
|
NamaScene = nama;
|
|
GetComponent<Animator>().Play("end");
|
|
}
|
|
|
|
public void Btn_Restart()
|
|
|
|
{
|
|
this.gameObject.SetActive(true);
|
|
NamaScene = SceneManager.GetActiveScene().name; // Simpan nama scene aktif
|
|
GetComponent<Animator>().Play("end");
|
|
}
|
|
|
|
|
|
public void Pindah_Scene()
|
|
{
|
|
SceneManager.LoadScene(NamaScene);
|
|
}
|
|
|
|
public void Exit()
|
|
{
|
|
|
|
Application.Quit();
|
|
|
|
}
|
|
}
|