FinalPLan.cs 1015 Bytes
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;

      
                                                              // 리스폰시간 초기화
        }

    }

}