Unity 에디터 버전 2023.1.0a21부터는 전용 서버 최적화를 에셋 번들에 적용할 수 있습니다.스크립팅을 통해 에셋 번들을 빌드할 수 있습니다.에셋 번들 빌드 전반에 대한 자세한 내용은 에셋 번들 섹션을 참조하십시오.
플레이어에 대해 설명한 것과 동일한 전용 서버 최적화를 거치도록 에셋 번들을 빌드하려면, BuildAssetBundle
메서드를 호출할 때 BuildAssetBundlesParameters
구조의 subtarget
필드를 StandaloneBuildSubtarget.Server
로 지정합니다.다음 예시를 참조하십시오.
BuildAssetBundlesParameters serverAssetBundleParameters =
{
outputPath = /*some example asset path here, not entirely relevant*/,
options = BuildAssetBundleOptions.None,
targetPlatform = BuildTarget.StandaloneWindows64, //alternately, the MacOS or Linux build targets, any desktop platform
subtarget = StandaloneBuildSubtarget.Server
};
BuildPipeline.BuildAssetBundles(serverAssetBundleParameters);
에셋 번들을 빌드한 후 런타임 시 플레이어가 로드할 수 있습니다.네이티브로 에셋 번들 사용을 참조하십시오.
경고:에셋 번들 로딩 프로세스는 에셋 번들 타겟 플랫폼이 플레이어의 타겟 플랫폼과 일치하는지 확인하지만, 에셋 번들 하위 타겟은 확인하지 않습니다.비서버 스탠드얼론 플레이어용으로 빌드된 에셋 번들을 로드하지 않아야 합니다.전용 서버 하위 타겟을 대상으로 하는 에셋 번들을 로드하지 마십시오(또는 그 반대도 마찬가지).
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.