WebAndUpdateHandler.cs
1.65 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
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
using System.Threading;
public class WebAndUpdateHandler : MonoBehaviour {
[DllImport ("CorePlugin")] public static extern int coreUpdateCheck();
[DllImport ("CorePlugin")] public static extern int coreUpdateInstall_player();
[DllImport ("CorePlugin")] public static extern int coreUpdateInstall_dict();
public GameObject update_box;
public GameObject update_dict;
public GameObject update_full;
public GameObject update_null;
public GameObject update_err;
public GameObject AGUARDE;
public void UpdateCheck()
{
Debug.Log("init update_check");
int updateStatus = 0;
updateStatus = coreUpdateCheck();
update_box.SetActive(true);
switch(updateStatus){
case 0:
Debug.Log ("update_null");
update_null.SetActive(true);
break;
case 1:
Debug.Log ("update_full");
update_full.SetActive(true);
break;
case 2:
Debug.Log ("update_dict");
update_dict.SetActive(true);
break;
case -1:
Debug.Log ("update_err");
update_err.SetActive(true);
break;
default:
break;
}
AGUARDE.SetActive(false);
Debug.Log("update_check finished");
}
public void UpdateInstall_player()
{
Debug.Log("init player update_install");
coreUpdateInstall_player();
Debug.Log("player update_install finished");
Application.Quit();
}
public void UpdateInstall_dict()
{
AGUARDE.SetActive(false);
Debug.Log("init dict update_install");
coreUpdateInstall_dict();
Debug.Log("dict update_install finished");
}
public void LoadVlibrasWebsite()
{
Application.OpenURL("http://vlibrasplayer.lavid.ufpb.br/");
}
}