Newer
Older
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI; //andr
using UnityEngine.SceneManagement;
using System.IO; //
using UnityEngine.Video;//streaming
using UnityEngine.Networking;
using static UIconfig;
using static StreamingAssetLoader;
public class SystemOptionsMenue_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;
Stefan Richter
committed
public Texture2D cursorArrow_35;
public Texture2D cursorArrow_50;
public Texture2D cursorArrow_60;
public Texture2D cursorArrow_70;
public Texture2D cursorArrow_100;
public Texture2D cursorArrow_140;
public Texture2D cursorArrow_200;
public Texture2D cursorArrow_300;
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
/*
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;
}
switch (CommunicationEvents.Opsys)
{
case 0:
Opsys_ButtonT.GetComponent<Text>().text = "Windows optimized";
Opsys_ButtonUT.GetComponent<Text>().text = "Press for changing optimzation";
Stefan Richter
committed
setMouse();
break;
case 1:
Opsys_ButtonT.GetComponent<Text>().text = "Android optimized: No mouse";
Opsys_ButtonUT.GetComponent<Text>().text = "Press for changing optimzation";
Stefan Richter
committed
setMouse();
Stefan Richter
committed
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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;
AutoOSreq_ButtonT.GetComponent<Text>().text = "Operating System Recognition: ON";
AutoOSreq_ButtonUT.GetComponentInChildren<Text>().text = "Press for deactivating";
break;
case true:
CommunicationEvents.autoOSrecognition = false;
//GameObject.Find("TextSlotTOO").GetComponent<Text>().text = "Touch controls OFF";
AutoOSreq_ButtonT.GetComponent<Text>().text = "Operating System Recognition: OFF";
AutoOSreq_ButtonUT.GetComponentInChildren<Text>().text = "Press for activating";
break;
Stefan Richter
committed
}
//updateUIpreview();
NetworkJSON_Save();
}
public void ChangeOpsysModes()
{
switch (CommunicationEvents.Opsys)
{
case 0:
CommunicationEvents.Opsys = 1;
Opsys_ButtonT.GetComponent<Text>().text = "Android optimized: No Mouse";
Opsys_ButtonUT.GetComponentInChildren<Text>().text = "Press for changing optimzation";
break;
case 1:
CommunicationEvents.Opsys = 0;
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;
}
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
break;
default:
CommunicationEvents.Opsys = 1;
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()
{
Stefan Richter
committed
//print("OPSYS: " + CommunicationEvents.Opsys);
if (CommunicationEvents.Opsys == 1)
{
CommunicationEvents.CursorVisDefault = false;
Stefan Richter
committed
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
}
else
{
Cursor.visible = true;
CommunicationEvents.CursorVisDefault = true;
}
//Android crashes in level scene;
if (CommunicationEvents.Opsys != 1)
{
double curssz = 1 / (UIconfig.cursorSize);
// print(UIconfig.cursorSize);
if (UIconfig.screWidth / 35 < curssz)
{
Cursor.SetCursor(cursorArrow_35, Vector2.zero, CursorMode.ForceSoftware);
print("m35");
}
else
{
if (UIconfig.screWidth / 50 < curssz)
{
Cursor.SetCursor(cursorArrow_50, Vector2.zero, CursorMode.ForceSoftware);
print("m50");
}
else
{
if (UIconfig.screWidth / 60 < curssz)
{
Cursor.SetCursor(cursorArrow_60, Vector2.zero, CursorMode.ForceSoftware);
print("m60");
}
else
{
if (UIconfig.screWidth / 70 < curssz)
{
Cursor.SetCursor(cursorArrow_70, Vector2.zero, CursorMode.ForceSoftware);
print("m70");
}
else
{
if (UIconfig.screWidth / 100 < curssz)
{
Cursor.SetCursor(cursorArrow_100, Vector2.zero, CursorMode.ForceSoftware);
print("m100");
}
else
{
if (UIconfig.screWidth / 140 < curssz)
{
Cursor.SetCursor(cursorArrow_140, Vector2.zero, CursorMode.ForceSoftware);
print("m140");
}
else
{
if (UIconfig.screWidth / 200 < curssz)
{
Cursor.SetCursor(cursorArrow_200, Vector2.zero, CursorMode.ForceSoftware);
print("m200");
}
else
{
Cursor.SetCursor(cursorArrow_300, Vector2.zero, CursorMode.ForceSoftware);
print("m300");
}
}
}
}
}
}
}
}
}
}