例如,认为我们有数据:
16 2019-07-07 12:00:00 2019-07-07 12:30:00
17 2019-07-07 14:00:00 2019-07-07 15:45:00
18 2019-07-07 15:00:00 2019-07-07 15:30:00
16 已创建
16 已更新
17 已创建
18 已创建
18 已更新
17 已更新
答案 0 :(得分:0)
您可以在模型中更改名称;
示例;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpawnObjects : MonoBehaviour
{
public Transform pickUp;
public Transform[] spawnPoints;
public float Timer = 10;
public float Timer1 = 15;
void Start()
{
if (spawnPoints.Length == 0)
{
Debug.LogError("No spawn points referenced.");
}
}
void Update()
{
Debug.Log("Spawning: " + pickUp.name);
Timer -= Time.deltaTime;
Timer1 -= Time.deltaTime;
if (Timer <= 0)
{
Transform _sp = spawnPoints[Random.Range(0, spawnPoints.Length)];
Instantiate(pickUp, _sp.position, _sp.rotation);
Timer = 10;
}
if(Timer1 <= 0)
{
//Destroy(pickUp);
Timer1 = 15;
}
}
}