유니티 내에서 List 사용시

|

using System.Collections.Generic;를 추가해줘야 된다.

private List<GameObject> _objList = new List<GameObject>(); 이런식으로 선언후



_objList .Add(gameObject) ; ->이런식으로 추가할수있다.


참조할때는 배열 처럼 참조하면된다.

Vector3 pos = _objList[0].transform.position; 

이런식으로

Trackback 0 And Comment 0