You need to sign in or sign up before continuing.
Newer
Older
using UnityEngine;
using UnityEngine.UI; //andr
public class SystemOptionsMenu_mobile : MonoBehaviour
{
public GameObject AutoOSreq_ButtonT;
public GameObject AutoOSreq_ButtonUT;
Stefan Richter
committed
public GameObject Opsys_ButtonT;
public GameObject Opsys_ButtonUT;
public GameObject FrameITUI_ButtonT;
public GameObject FrameITUI_ButtonUT;
public GameObject AutoSettingsAdap_Button;
public GameObject AutoSettingsAdap_ButtonUT;
Stefan Richter
committed
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
/*
public GameObject TAV_Slider;
public GameObject TAvisibilityT;
*/
private Color colChangeable = new Color(1f, 1f, 1f, 0.5f);
private Color colChangeable2 = new Color(1f, 1f, 1f, 0.5f);
//public GameObject TouchModeButton;
//public GameObject back_GObj;
void Start()
{
UpdateUI_6();
}
private void Update()
{
UpdateUI_6();
}
void UpdateUI_6()
{
switch (CommunicationEvents.autoOSrecognition)
{
case false:
AutoOSreq_ButtonT.GetComponent<Text>().text = "Operating System Recognition: OFF";
AutoOSreq_ButtonUT.GetComponent<Text>().text = "Press for activating";
break;
case true:
AutoOSreq_ButtonT.GetComponent<Text>().text = "Operating System Recognition: ON";
AutoOSreq_ButtonUT.GetComponent<Text>().text = "Press for deactivating";
break;
}
case 0:
//GameObject.Find("TextSlotTOO").GetComponent<Text>().text = "Touch controls OFF";
AutoSettingsAdap_Button.GetComponent<Text>().text = "Settings Adaption: OFF";
AutoSettingsAdap_ButtonUT.GetComponentInChildren<Text>().text = "Press for activating";
break;
case 1:
AutoSettingsAdap_Button.GetComponent<Text>().text = "Settings Adaption: Input";
AutoSettingsAdap_ButtonUT.GetComponentInChildren<Text>().text = "Press for changing";
break;
case 2:
AutoSettingsAdap_Button.GetComponent<Text>().text = "Settings Adaption: Input & UI";
AutoSettingsAdap_ButtonUT.GetComponentInChildren<Text>().text = "Press for deactivating";
default:
AutoSettingsAdap_Button.GetComponent<Text>().text = "Settings Adaption: OFF";
AutoSettingsAdap_ButtonUT.GetComponentInChildren<Text>().text = "Press for activating";
break;
switch (CommunicationEvents.Opsys)
{
Opsys_ButtonT.GetComponent<Text>().text = "Windows/Desktop optimized";
Opsys_ButtonUT.GetComponent<Text>().text = "Press for changing optimzation";
Stefan Richter
committed
setMouse();
Opsys_ButtonT.GetComponent<Text>().text = "Android/Mobile optimized: No mouse, No Datapath";
Opsys_ButtonUT.GetComponent<Text>().text = "Press for changing optimzation";
Stefan Richter
committed
setMouse();
Stefan Richter
committed
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
default:
Opsys_ButtonT.GetComponent<Text>().text = "Not optimized";
Opsys_ButtonUT.GetComponent<Text>().text = "Press for changing optimzation";
break;
}
switch (UIconfig.FrameITUIversion)
{
case 1:
FrameITUI_ButtonT.GetComponent<Text>().text = "FrameITUI";
FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
break;
case 2:
FrameITUI_ButtonT.GetComponent<Text>().text = "FrameITUI_mobile: Touchscreen";
FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
break;
default:
FrameITUI_ButtonT.GetComponent<Text>().text = "Not optimized";
FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
break;
}
/*
TAV_Slider.GetComponent<Slider>().value = UIconfig.TAvisibility;
TAvisibilityT.GetComponent<Text>().text = "Touch area visibility " + (int)(100 * UIconfig.TAvisibility) + "%";
*/
//updateUIpreview();
}
Stefan Richter
committed
public void ChangeAutoOSrecognition()
{
switch (CommunicationEvents.autoOSrecognition)
{
case false:
CommunicationEvents.autoOSrecognition = true;
break;
case true:
CommunicationEvents.autoOSrecognition = false;
break;
}
NetworkJSON_Save();
UpdateUI_6();
public void ChangeAutoSettingsAdaption()
{
switch (UIconfig.autoSettingsAdaption)
{
case 0:
UIconfig.autoSettingsAdaption = 1;
case 1:
UIconfig.autoSettingsAdaption = 2;
break;
case 2:
UIconfig.autoSettingsAdaption = 0;
break;
default:
UIconfig.autoSettingsAdaption = 0;
break;
}
//updateUIpreview();
NetworkJSON_Save();
UpdateUI_6();
public void ChangeOpsysModes()
{
switch (CommunicationEvents.Opsys)
{
case OperationSystem.Windows:
CommunicationEvents.Opsys = OperationSystem.Android;
Opsys_ButtonT.GetComponent<Text>().text = "Android optimized: No Mouse";
Opsys_ButtonUT.GetComponentInChildren<Text>().text = "Press for changing optimzation";
break;
case OperationSystem.Android:
CommunicationEvents.Opsys = OperationSystem.Windows;
Opsys_ButtonT.GetComponent<Text>().text = "Windows optimized";
Opsys_ButtonUT.GetComponentInChildren<Text>().text = "Press for changing optimzation";
Stefan Richter
committed
if (UIconfig.MouseKeepingInWindow == true)
{
Cursor.lockState = CursorLockMode.Confined;
}
else
{
Cursor.lockState = CursorLockMode.None;
}
break;
default:
CommunicationEvents.Opsys = OperationSystem.Android;
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
Opsys_ButtonT.GetComponent<Text>().text = "Not optimized";
Opsys_ButtonUT.GetComponentInChildren<Text>().text = "Press for changing optimzation";
break;
}
//updateUIpreview();
NetworkJSON_Save();
}
public void ChangeFrameITUIvers()
{
switch (UIconfig.FrameITUIversion)
{
case 1:
UIconfig.FrameITUIversion = 2;
FrameITUI_ButtonT.GetComponent<Text>().text = "FrameITUI_mobile: Touchscreen";
FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
break;
case 2:
UIconfig.FrameITUIversion = 1;
FrameITUI_ButtonT.GetComponent<Text>().text = "FrameITUI";
FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
break;
default:
UIconfig.FrameITUIversion = 1;
FrameITUI_ButtonT.GetComponent<Text>().text = "Not optimized";
FrameITUI_ButtonUT.GetComponent<Text>().text = "Press for changing UI";
break;
}
//updateUIpreview();
NetworkJSON_Save();
}
public void touchAreaVisibilityBttn()
{
/*
UIconfig.TAvisibility = TAV_Slider.GetComponent<Slider>().value;
TAvisibilityT.GetComponent<Text>().text = "Touch area visibility " + (int)(100 * UIconfig.TAvisibility) + "%";
//updateUIpreview();
*/
}
Stefan Richter
committed
public void setMouse()
{
updateMouseCursor.setMouse();
Stefan Richter
committed
}