using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TransformFeng2 : MonoBehaviour
{
//bullet
public GameObject cubebullet;
//发射点
public Transform tra;
//时间
float Timer = 0;
// Update is called once per frame
void Update()
{
//每帧加一帧的时间
Timer += Time.deltaTime;
//每两秒复制一次
if (Timer > 2)
{
//<>泛型,cubebullet复制物体,一般为预设体。tra.position复制坐标,tra.rotation复制角度
GameObject bullet = Instantiate<GameObject>(cubebullet, tra.position, tra.rotation);
Timer = 0;
Debug.Log("每隔两秒复制一次");
}
}
}