pragma strict var inputText String var see bool private var keyboard T

 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
#pragma strict
var inputText : String = "";
var see: bool;
private var keyboard : TouchScreenKeyboard;
function Start () {
see = false;
}
function Update () {
if (keyboard){
inputText = keyboard.text;
}
if(see == true){
if (!keyboard){
print("ebat");
if(inputText == "Алистер" || inputText == "алистер" || inputText == "alistair" || inputText == "Alistair")
{
print("Quit");
} else {
Application.Quit();
}
}
}
if (Input.touchCount > 0)
{
var ray = Camera.main.ScreenPointToRay (Input.GetTouch(0).position);
var hit : RaycastHit;
var dist : float = 1.0f;
if (Physics.Raycast (ray, hit, dist))
{
Debug.Log(" You just hit " + hit.collider.gameObject.name);
if(hit.collider.tag == "Finish")
{
print("ok");
keyboard = TouchScreenKeyboard.Open(inputText);
see = true;
}
}
}
}
//function OnGUI() {
// if (GUI.Button(Rect(0, 10, 200, 32), inputText))
// keyboard = TouchScreenKeyboard.Open(inputText);
//
//
//
//}