Skip to content

Instantly share code, notes, and snippets.

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