-
instantiate함수
총알을 발사하는 등 Object를 동적으로 생성할 때 사용.
사용 Ex
1. Resources.Load(폴더/프리팹파일명)
GameObject r1 = Resources.Load("fb") as GameObject2. Instantiate(생성할 오브젝트, 생성할 위치, 생성시 각도);
(정할 각도가 없다면 Quaternion.identity를 사용)
GameObject o1 = Instantiate(r1)3. Object설정
좌표 또는 transform.SetParent(부모Transform)으로 부모관계 설정'Unity' 카테고리의 다른 글
Unity - Ray (0) 2021.03.19 Unity - Translate (0) 2021.03.18 Unity - Mouse (Input class) (0) 2021.03.18 Unity - Material (0) 2021.03.18 Unity - UnityChan Transition(Animation) (0) 2020.11.16 Unity - UnityChan Model Improt (0) 2020.11.16 Unity - UnityChan으로 이동 연습 (Unity기초) (0) 2020.11.16 Unity - Transform (0) 2020.11.14