-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResetPlayerPrefs.cs
More file actions
39 lines (33 loc) · 1 KB
/
ResetPlayerPrefs.cs
File metadata and controls
39 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class ResetPlayerPrefs : MonoBehaviour
{
public int ExperimentScene = 3;
public bool debugMode = false;
public GameObject newPlayerPanel;
public GameObject infoPanel;
// Debug version will delete the player prefs if they exist but normal version shouldn't do that but instead just continue.
public void PlayerResume()
{
if (PlayerPrefs.HasKey("userID"))
{
if (debugMode)
{
PlayerPrefs.DeleteAll();
}
else
{
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(ExperimentScene, LoadSceneMode.Single);
}
}
}
public void PlayerNew()
{
// Close this panel and start new panel;
newPlayerPanel.SetActive(false);
infoPanel.SetActive(true);
}
}