GameObject.FindGameObjectsWithTag

来源:互联网 发布:svn默认端口号是多少 编辑:程序博客网 时间:2024/06/09 21:06
using UnityEngine;using System.Collections;public class ExampleClass : MonoBehaviour{    public GameObject respawnPrefab;    public GameObject[] respawns;    void Start()    {        if (respawns == null)            respawns = GameObject.FindGameObjectsWithTag("Respawn");        foreach (GameObject respawn in respawns)        {            Instantiate(respawnPrefab, respawn.transform.position, respawn.transform.rotation);        }    }}
阅读全文
0 0