-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTu57Move.cs
70 lines (62 loc) · 1.86 KB
/
Tu57Move.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Tu57Move : MonoBehaviour
{
public GameObject Tutorial57, Tutorial;
AntMove antmove;
Tu13Move tu13;
int btncnt = 0;
float time;
public float blinkTime = 0.5f;
// Start is called before the first frame update
void Start()
{
Tutorial57.SetActive(false);
antmove = GameObject.Find("ant").GetComponent<AntMove>();
tu13 = gameObject.GetComponent<Tu13Move>();
}
// Update is called once per frame
void Update()
{
if (Tutorial.activeSelf == false)
{
Tutorial57.SetActive(false);
}
if (Tutorial.activeSelf == true && (tu13.tuOrder == 5 || tu13.tuOrder == 7))
{
if (time < blinkTime)
{
Tutorial57.SetActive(true);
}
else
{
Tutorial57.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)
{
tu13.tuOrder = 5;
}
if (Input.GetKey(KeyCode.D) && Input.GetKey(KeyCode.J) && Input.GetKey(KeyCode.A) && tu13.tuOrder == 5)
{
tu13.tuOrder = 6;
Tutorial57.SetActive(false);
}
else if (Input.GetKey(KeyCode.D) && Input.GetKey(KeyCode.A) && Input.GetKeyDown(KeyCode.J) && tu13.tuOrder == 7)
{
tu13.tuOrder = 8;
Tutorial57.SetActive(false);
}
}
}
}