앞의 “에셋 번들 워크플로” 섹션에서는 BuildPipeline.BuildAssetBundles
를 사용하여 에셋 번들을 빌드하는 방법을 설명했습니다. 이 API 호출은 각 에셋 번들에 대한 에셋 번들 파일과 .manifest 파일을 포함하여 빌드 프로세스 결과를 지정된 출력 디렉토리에 작성합니다. 이 섹션에서는 빌드 프로세스에서 작성되는 파일에 대한 세부 정보를 설명합니다.
이 파일은 .manifest 확장자가 없는 파일로서 에셋을 로드하기 위해 런타임 시점에 로드해야 하는 파일입니다.
에셋 번들 파일은 내부에 여러 파일을 포함하는 아카이브입니다. 다음은 일반적인 에셋 번들의 예시 구조입니다.
메인 파일은 Unity의 바이너리 SerializedFile 포맷을 사용합니다. 여기에는 에셋 번들 오브젝트와 에셋 번들에 (명시적 또는 암시적으로) 포함된 모든 에셋의 오브젝트가 포함됩니다. 모든 오디오, 비디오 콘텐츠는 .resource 파일에 저장되고 텍스처 데이터는 .resS 파일에 저장됩니다.
씬 에셋 번들 내부의 콘텐츠는 비슷하지만 개별 씬의 스트림 로딩에 최적화되어 있습니다. 여기에는 씬당 두 개의 SerializedFile이 포함됩니다.
추가 매니페스트 번들을 포함하여 생성된 모든 에셋 번들에 대해 관련 매니페스트 파일이 생성됩니다. 매니페스트 파일은 .manifest 확장자를 사용하며 텍스트 에디터로 열 수 있습니다. 여기에는 번들에 대한 CRC(순환 중복 검사) 데이터 및 종속성 데이터와 같은 정보가 포함됩니다. 일반적인 에셋 번들의 매니페스트 파일은 다음과 같습니다.
ManifestFileVersion: 0
CRC: 2422268106
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 8b6db55a2344f068cf8a9be0a662ba15
TypeTreeHash:
serializedVersion: 2
Hash: 37ad974993dbaa77485dd2a0c38f347a
HashAppended: 0
ClassTypes:
- Class: 91
Script: {instanceID: 0}
Assets:
Asset_0: Assets/Mecanim/StateMachine.controller
Dependencies: {}
포함된 에셋, 종속성, 그리고 기타 정보를 보여줍니다.
빌드에 의해 생성되는 두 개의 추가 파일이 있습니다.
첫 번째는 작은 에셋 번들로, 해당 파일이 위치한 디렉토리(에셋 번들이 빌드된 디렉토리)의 이름을 차용했습니다. 이 파일은 Manifest Bundle
이라고 하며, 런타임에 로드할 번들 종속성을 파악하는 데 유용한 AssetBundleManifest 오브젝트가 포함되어 있습니다. 이 번들 및 매니페스트 오브젝트 사용 방법에 대한 자세한 내용은 네이티브로 에셋 번들 사용 기술 자료를 참조하십시오.
매니페스트 번들에 대한 .manifest 파일도 생성됩니다. 파일 콘텐츠는 다음과 같습니다.
ManifestFileVersion: 0
AssetBundleManifest:
AssetBundleInfos:
Info_0:
Name: scene1assetbundle
Dependencies: {}
매니페스트 번들에 대한 .manifest 파일은 에셋 번들의 관계와 종속성을 기록합니다. 이는 매니페스트 번들 내부의 AssetBundleManifest 오브젝트가 기록하는 정보와 유사하며, 텍스트 파일이므로 가독성을 높이고 외부 툴에서 구문 분석하기 편리합니다. 에셋 번들에서 사용하는 유형이 플레이어 빌드의 콘텐츠에서 사용되지 않는 경우, 이 .manifest 파일은 해당 유형에 대한 code stripping
을 방지하는 데 중요합니다. 플레이어 설정에서 코드 스트리핑이 활성화된 경우, 플레이어 빌드를 수행할 때 BuildPlayerOptions.assetBundleManifestPath를 설정하여 이 매니페스트의 경로를 전달해야 합니다. 코드 스트리핑에 대한 자세한 내용은 배포 크기 및 코드 스트리핑을 참조하십시오.
참고: BuildPipeline.BuildAssetBundles
대신 어드레서블 패키지를 사용하여 빌드하는 경우 동일한 포맷의 에셋 번들 파일이 작성되지만, 매니페스트 파일이 없고 매니페스트 번들도 생성되지 않습니다. 자세한 내용은 어드레서블 기술 자료를 참조하십시오.
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.