forked from vaibhav899050/PastClones-IGDC-GameDev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayerselect.cs
53 lines (44 loc) · 1.42 KB
/
playerselect.cs
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using UnityEngine.SceneManagement;
public class playerselect : MonoBehaviour
{
public void select()
{
select playerdata = new select();
playerdata.num = 1;
//j3.text = namem.text;
string gamed = JsonUtility.ToJson(playerdata, true);
string path = Application.persistentDataPath + "/playernum.json";
//n3.SetActive(true);
Debug.Log(path);
File.WriteAllText(path, gamed);
SceneManager.LoadScene("levelselector");
}
public void select1()
{
select playerdata = new select();
playerdata.num = 2;
//j3.text = namem.text;
string gamed = JsonUtility.ToJson(playerdata, true);
string path = Application.persistentDataPath + "/playernum.json";
//n3.SetActive(true);
Debug.Log(path);
File.WriteAllText(path, gamed);
SceneManager.LoadScene("levelselector");
}
public void select2()
{
select playerdata = new select();
playerdata.num = 3;
//j3.text = namem.text;
string gamed = JsonUtility.ToJson(playerdata, true);
string path = Application.persistentDataPath + "/playernum.json";
//n3.SetActive(true);
Debug.Log(path);
File.WriteAllText(path, gamed);
SceneManager.LoadScene("levelselector");
}
}