WebAndUpdateHandler.cs
1.18 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
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
public class WebAndUpdateHandler : MonoBehaviour {
[DllImport ("CorePlugin")] public static extern int coreUpdateCheck();
[DllImport ("CorePlugin")] public static extern int coreUpdateInstall();
public GameObject update_box;
public GameObject update_found;
public GameObject update_not_found;
public GameObject update_err;
public void UpdateCheck()
{
Debug.Log("init update_check");
int updateStatus = 1;
updateStatus = coreUpdateCheck();
update_box.SetActive(true);
switch(updateStatus){
case 0:
Debug.Log ("update_null");
update_not_found.SetActive(true);
break;
case 1:
Debug.Log ("update_avaliable");
update_found.SetActive(true);
break;
case -1:
Debug.Log ("update_err");
update_err.SetActive(true);
break;
default:
break;
}
Debug.Log("update_check finished");
}
public void UpdateInstall()
{
Debug.Log("init update_install");
//coreUpdateInstall();
Debug.Log("updating_install finished");
Application.Quit();
}
public void LoadVlibrasWebsite()
{
Application.OpenURL("http://vlibrasplayer.lavid.ufpb.br/");
}
}