자기상위오브젝트(parent object)를 호출하는 방법!
프로그래밍/C#2014. 1. 24. 17:17
상위 오브젝트를 호출하는 방법 -> childObject.transform.parent
상위 오브젝트 밑에 만들기! -> childObject.transform.parent = parentObject.transform;
void CreateObject(){
GameObject ChildObject; // 하위오브젝트
GameObject ParentObject; // 상위오브젝트
GameObject NonObject = Instantiate(ChildObject); // 하위오브젝트 생성
NonObject.transform.parent = ParentObject.transform; // 하위오브젝트의 상위객체로 상위오브젝트를 연결
}
'프로그래밍 > C#' 카테고리의 다른 글
Invalid rank specifier: expected `,' or `]' (0) | 2015.02.16 |
---|---|
java.lang.IllegalStateException: Could not execute method of the activity (0) | 2014.11.25 |
error CS1519: Unexpected symbol `for' in class, struct, or interface member declaration (0) | 2014.11.04 |
[C#] MemoryPool(메모리풀) (0) | 2014.01.08 |
코루틴(Coroutine)이란? Update()와 차이 (2) | 2014.01.03 |