Skip to content

Instantly share code, notes, and snippets.

@IndieGameMaker
Created March 8, 2021 08:31
Show Gist options
  • Save IndieGameMaker/3e5e7b2483173fffc4fe5adb6ad8e3f2 to your computer and use it in GitHub Desktop.
Save IndieGameMaker/3e5e7b2483173fffc4fe5adb6ad8e3f2 to your computer and use it in GitHub Desktop.
[스크립트 8-1] GameManager - SpawnPointGroup 하위의 Transform 컴포넌트 추출
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour
{
//몬스터가 출현할 위치를 저장할 배열
public Transform[] points;
void Start()
{
//SpawnPointGroup 게임오브젝트의 Transform 컴포넌트 추출
Transform spawnPointGroup = GameObject.Find("SpawnPointGroup")?.transform;
//SpawnPointGroup 하위의 모든 차일드 게임오브젝트의 Transform 컴포넌트를 추출
points = spawnPointGroup.GetComponentsInChildren<Transform>();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment