-
Notifications
You must be signed in to change notification settings - Fork 0
/
CurrentMode.cs
70 lines (62 loc) · 1.46 KB
/
CurrentMode.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
//using TMPro;
public class CurrentMode : MonoBehaviour
{
public GroundController g = GroundController.Instance;
public string textBox;
public int mode2 = 0;
public Text textBox2;
void Start()
{
textBox = "mode not found";
textBox2 = this.GetComponent<Text>();
//textBox2 = new Text();
g = GroundController.Instance;
//text = g.currentMode;
mode2 = (int) g.currentMode;
textBox = ModeToString(mode2);
textBox2.text = "Mode: " + textBox;
}
void Update()
{
if (mode2 != (int)g.currentMode)
{
mode2 = (int)g.currentMode;
textBox = ModeToString(mode2);
textBox2.text = "Mode: " + textBox;
}
}
public string ModeToString(int m)
{
if (m==0)
{
return "x";
} else if (m==1)
{
return "y";
} else if (m==2)
{
return "z";
}
else if (m == 3)
{
return "size";
}
else if (m == 4)
{
return "move";
}
else if (m == 5)
{
return "merge";
}
else if (m == 6)
{
return "delete";
}
return "idk update the code";
}
}