Example #1
0
    private void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;
        DontDestroyOnLoad(gameObject);

        Info        = info;
        currentUser = null;
    }
Example #2
0
 public static void LogOut()
 {
     currentUser = null;
 }
Example #3
0
 public static void LogIn(string username, int score)
 {
     currentUser          = ScriptableObject.CreateInstance <UserInfoSO>();
     currentUser.username = username;
     currentUser.score    = score;
 }