Newer
Older
using UnityEngine;
using UnityEngine.UI; //andr
using static UIconfig;
public class ControlOptionsMenuPreview_mobile : MonoBehaviour
{
public GameObject ExBttnPreview1;
public GameObject ExBttnPreview2l;
public GameObject ExBttnPreview2r;
public GameObject ExDpadPreview1;
public GameObject ExDpadPreview2;
//public GameObject
//public GameObject
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()
{
Update();
}
private void Update()
{
updateUIpreview();
}
public void updateUIpreview()
{
if (UIconfig.controlMode == ControlMode.Mobile)
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
{
colChangeable.a = UIconfig.TAvisibility;
colChangeable2.a = (UIconfig.TAvisibility) / 5;
switch (UIconfig.touchControlMode)
{
case 1:
ExBttnPreview1.GetComponentInChildren<Image>().color = colChangeable;
ExBttnPreview2l.GetComponentInChildren<Image>().color = colChangeable;
ExBttnPreview2r.GetComponentInChildren<Image>().color = colChangeable;
ExDpadPreview1.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExDpadPreview2.GetComponentInChildren<Image>().color = UIconfig.colClear;
break;
case 2:
ExBttnPreview1.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExBttnPreview2l.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExBttnPreview2r.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExDpadPreview1.GetComponentInChildren<Image>().color = colChangeable2;
ExDpadPreview2.GetComponentInChildren<Image>().color = colChangeable2;
break;
case 3:
ExBttnPreview1.GetComponentInChildren<Image>().color = colChangeable;
ExBttnPreview2l.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExBttnPreview2r.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExDpadPreview1.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExDpadPreview2.GetComponentInChildren<Image>().color = colChangeable2;
break;
default:
ExBttnPreview1.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExBttnPreview2l.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExBttnPreview2r.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExDpadPreview1.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExDpadPreview2.GetComponentInChildren<Image>().color = UIconfig.colClear;
break;
}
}
else
{
ExBttnPreview1.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExBttnPreview2l.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExBttnPreview2r.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExDpadPreview1.GetComponentInChildren<Image>().color = UIconfig.colClear;
ExDpadPreview2.GetComponentInChildren<Image>().color = UIconfig.colClear;
}
}