FinalPLan.cs
1015 Bytes
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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;
using UnityEngine.XR;
using UnityEngine.XR.ARSubsystems;
public class FinalPLan : MonoBehaviour
{
public GameObject PrefabToInstantiate;
private float sponTime = 0.5f;
private void Awake()
{
}
private void Update()
{
sponTime -= Time.deltaTime; // 리스폰 시간을 깍음.
if (sponTime < 0) // 리스폰 시간이 0이 되었는지 검사
{
var item = GameObject.FindWithTag("HeyBee");
Vector3 NNNN = new Vector3(transform.position.x, item.transform.position.y, transform.position.z);
Instantiate(PrefabToInstantiate, NNNN, transform.rotation); // 생성
Debug.Log("PlacemnetIndicator Generate Sucess!");
sponTime = 0.5f;
// 리스폰시간 초기화
}
}
}