TutorialManager.cs
2.09 KB
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
102
103
104
105
106
using UnityEngine;
using UnityEngine.UI;
public class TutorialManager : MonoBehaviour {
public ScreenManager screenManager;
public Text description;
public Image translateImage;
public Image micImage;
public Image dictionaryImage;
public Image subtitlesImage;
public GameObject sliderShadow;
public Color enabledColor;
public Color disabledColor;
private int index = 0;
private string[] descriptions = new string[] {
"Tradução de Texto\n\nNessa opção você pode entrar com um texto para ser traduzido!",
"Tradução de Fala\n\nNessa opção, o que você falar será traduzido para LIBRAS",
"Dicionário\n\nNessa opção você pode ver e reproduzir todos os sinais disponíveis no VLibras",
"Legendas\n\nNessa opção você pode ativar e desativar as legendas enquanto o sinal é traduzido",
"Barra de velocidade\n\nNa barra você pode escolher a velocidade que deseja visualizar o sinal",
};
private Image[] buttons;
protected void Start ()
{
if (Screen.dpi < 140)
{
this.description.fontSize = 14;
}
// 240
else if (Screen.dpi < 280)
{
this.description.fontSize = 20;
}
// 320
else if (Screen.dpi < 400)
{
this.description.fontSize = 30;
}
// 480
else if (Screen.dpi < 500)
{
this.description.fontSize = 44;
}
else
{
this.description.fontSize = 14;
}
this.buttons = new Image[] {
this.translateImage,
this.micImage,
this.dictionaryImage,
this.subtitlesImage
};
}
private Image getButton() {
return this.index <= 3 ? this.buttons[this.index] : null;
}
public void next()
{
if (this.index == 4)
{
this.screenManager.hideScreen();
select(0);
}
else
{
#if UNITY_IOS
// Jump mic
select(this.index == 0 ? 2 : this.index + 1);
#else
select(this.index + 1);
#endif
}
}
public void select(int index)
{
if (this.index <= 3)
getButton().color = disabledColor;
else
this.sliderShadow.SetActive(true);
this.index = index;
if (this.index <= 3)
getButton().color = enabledColor;
else
this.sliderShadow.SetActive(false);
this.description.text = this.descriptions[index];
}
}