-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTu48Move.cs
94 lines (82 loc) · 2.46 KB
/
Tu48Move.cs
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Tu48Move : MonoBehaviour
{
public GameObject tu48, Tutorial;
Tu13Move tu13;
AntMove antmove;
bool check = false;
int btncnt = 0;
float time;
public float blinkTime = 0.5f;
// Start is called before the first frame update
void Start()
{
tu48.SetActive(false);
antmove = GameObject.Find("ant").GetComponent<AntMove>();
tu13 = gameObject.GetComponent<Tu13Move>();
}
// Update is called once per frame
void Update()
{
if (Tutorial.activeSelf == false)
{
tu48.SetActive(false);
}
if (Tutorial.activeSelf == true && (tu13.tuOrder == 4 || tu13.tuOrder == 8))
{
if (time < blinkTime)
{
tu48.SetActive(true);
}
else
{
tu48.SetActive(false);
if (time > blinkTime * 2)
{
time = 0.0f;
}
}
time += Time.deltaTime;
btncnt = 0;
for (int i = 0; i < 6; i++)
{
if (antmove.btn[i, 0] == 1) btncnt++;
}
if (btncnt < 2)
{
if (tu13.tuOrder == 4)
{
tu13.tuOrder = 1;
tu48.SetActive(false);
}
else
{
tu13.tuOrder = 5;
tu48.SetActive(false);
}
}
if (Input.GetKey(KeyCode.K) && Input.GetKey(KeyCode.D) && Input.GetKey(KeyCode.J))
{
check = true;
}
else if (Input.GetKey(KeyCode.D) && Input.GetKey(KeyCode.J) && Input.GetKey(KeyCode.A))
{
check = true;
}
if (check && Input.GetKeyUp(KeyCode.K) && Input.GetKey(KeyCode.D) && Input.GetKey(KeyCode.J))
{
tu13.tuOrder = 5;
check = false;
tu48.SetActive(false);
}
else if (check && Input.GetKeyUp(KeyCode.A) && Input.GetKey(KeyCode.D) && Input.GetKey(KeyCode.J))
{
tu13.tuOrder = 9;
check = false;
tu48.SetActive(false);
}
}
}
}