TutorialManager.cs
2.25 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 Image infoImage;
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",
"Sobre o VLibras\n\nNessa opção você tem acesso a informações adicionais sobre nossa aplicação",
"Barra de velocidade\n\nNa barra você pode escolher a velocidade que deseja visualizar o sinal",
};
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;
}
}
private Image getButton()
{
switch (this.index)
{
case 0: return this.translateImage;
case 1: return this.micImage;
case 2: return this.dictionaryImage;
case 3: return this.subtitlesImage;
case 4: return this.infoImage;
default: return null;
}
}
public void next()
{
if (index == 5)
{
//this.gameObject.SetActive(false);
this.screenManager.switchToMakersScreen();
select(0);
}
else select(this.index + 1);
}
public void select(int index)
{
if (this.index <= 4)
getButton().color = disabledColor;
else
this.sliderShadow.SetActive(true);
this.index = index;
if (this.index <= 4)
{
getButton().color = enabledColor;
this.description.text = this.descriptions[index];
}
else
{
this.sliderShadow.SetActive(false);
this.description.text = this.descriptions[index];
}
}
}