Newer
Older
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using System.IO;
using UnityEngine.Video;//streaming
using UnityEngine.Networking;
//using static StreamingAssetLoader;
//using static CheckServer;
//using static CommunicationEvents;
using static UIconfig;
public class MainPlayerMode_Ctrl : MonoBehaviour
{
//public int myUI_ID;
public GameObject myself_GObj;
//public GameObject parent_GObj;
//public int backUI_ID;
//public int optionsUI_ID;
//public int failedUI_ID;
public GameObject FirstPerson_GObj;
public GameObject FirstPersonOldInpOrig_GObj;
public GameObject ThirdPerson_GObj;
private int GpMode_before=-99;
void Start()
{
Update2();
}
private void Update()
{
if (GpMode_before!= UIconfig.GameplayMode)
{
Update2();
print(UIconfig.GameplayMode);
}
}
private void Update2(){
//Todo Eventbased
ClearUIC();
print("hey"+ UIconfig.GameplayMode);
switch (UIconfig.GameplayMode)
{
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
ThirdPerson_GObj.gameObject.SetActive(true);
break;
case 5:
FirstPerson_GObj.gameObject.SetActive(true);
break;
case 6:
FirstPersonOldInpOrig_GObj.gameObject.SetActive(true);
break;
default:
break;
}
GpMode_before = UIconfig.GameplayMode;
}
/// <summary>
/// Deactivates all Pages.
/// </summary>
private void ClearUIC()
{
for (int i = 0; i < myself_GObj.transform.childCount; i++)
{
myself_GObj.transform.GetChild(i).gameObject.SetActive(false);
}
}
}