Created
March 8, 2021 08:31
-
-
Save IndieGameMaker/3e5e7b2483173fffc4fe5adb6ad8e3f2 to your computer and use it in GitHub Desktop.
[스크립트 8-1] GameManager - SpawnPointGroup 하위의 Transform 컴포넌트 추출
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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