Unity의 프리팹 시스템에서 Prefab Assets 는 템플릿 역할을 합니다. 에디터에서 생성한 프리팹 에셋은 Project 창에서 에셋으로 저장됩니다. Prefab Assets 에서 프리팹 인스턴스 를 원하는 만큼 생성할 수 있습니다. 프리팹 인스턴스는 에디터에서 생성하여 씬의 일부로 저장하거나, 런타임 시점에 인스턴스화할 수 있습니다.
프리팹 에셋을 생성하려면 Hierarchy 창의 게임 오브젝트를 Project 창으로 드래그하십시오. 게임 오브젝트 및 그와 관련된 모든 컴포넌트와 자식 게임 오브젝트가 Project 창에서 새로운 에셋이 됩니다. Project 창의 프리팹 에셋은 Project 창의 설정 방식에 따라 게임 오브젝트의 썸네일 뷰 또는 파란색 큐브 프리팹 아이콘으로 표시됩니다.
또한 이 프로세스를 통해 프리팹 에셋을 생성하면 원본 게임 오브젝트가 프리팹 인스턴스로 변합니다. 즉, 새롭게 생성된 프리팹 에셋의 인스턴스가 됩니다. 프리팹 인스턴스는 계층에서 파란색 텍스트로 표시되고, 프리팹의 루트 게임 오브젝트는 빨간색, 녹색 및 파란색 게임 오브젝트 아이콘이 아니라 파란색 큐브 프리팹 아이콘으로 표시됩니다.
Project 뷰의 프리팹 에셋을 Hierarchy 또는 Scene 뷰로 드래그하여 에디터에서 프리팹 에셋의 인스턴스를 생성할 수 있습니다.
또한 스크립팅을 사용하여 런타임 시점에 프리팹의 인스턴스를 만들 수도 있습니다. 자세한 내용은 프리팹 인스턴스화를 참조하십시오.
2018–07–31 일부 편집 리뷰를 거쳐 페이지 게시됨
2018.3에서 네스티드 프리팹과 프리팹 배리언트 추가됨
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.