コード例 #1
0
    List <GameObject> GetAllSpawnPoints()
    {
        List <GameObject> spawnPoints = new List <GameObject>();
        var rootObjects = SceneManager.GetActiveScene().GetRootGameObjects();
        var gameObjects = SceneUtils.GetAllObjectsInScene(rootObjects);

        foreach (GameObject gameObject in gameObjects)
        {
            if (!gameObject.name.Contains(_spawnPointPrefabName))
            {
                continue;
            }

            spawnPoints.Add(gameObject);
        }

        return(spawnPoints);
    }