-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSpacePmove.cs
50 lines (45 loc) · 1.12 KB
/
SpacePmove.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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpacePmove : MonoBehaviour
{
GameObject ht, ant;
AntMove antmove;
float time;
public float blinkTime = 0.5f;
void Awake()
{
ht = GameObject.Find("SpaceImage2");
ant = GameObject.Find("ant");
antmove = ant.GetComponent<AntMove>();
}
// Start is called before the first frame update
void Start()
{
gameObject.SetActive(false);
ht.SetActive(false);
}
// Update is called once per frame
void Update()
{
if (time < blinkTime)
{
ht.SetActive(true);
}
else
{
ht.SetActive(false);
if (time > blinkTime * 2)
{
time = 0.0f;
}
}
time += Time.deltaTime;
if (Input.GetKeyDown(KeyCode.Space))
{
GameObject.Find("Canvas").GetComponent<PopupLoad>().chkBread = true;
gameObject.SetActive(false);
ht.SetActive(false);
}
}
}