24 lines
490 B
C#
24 lines
490 B
C#
using UnityEngine;
|
|
|
|
public class GlobalUser : MonoBehaviour
|
|
{
|
|
public static GlobalUser Instance;
|
|
public string namaUser;
|
|
public int userId;
|
|
public string noAbsen;
|
|
|
|
private void Awake()
|
|
{
|
|
if (Instance == null)
|
|
{
|
|
Instance = this;
|
|
DontDestroyOnLoad(gameObject);
|
|
}
|
|
else
|
|
{
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|
|
|
|
//kode ini digunakan untuk menyimpan data user agar tidak hilang saat pindah scene |