Unity에는 유니버설 Windows 플랫폼과 Xbox One 플랫폼의 IL2CPP에 대한 Windows 런타임 지원이 포함되어 있습니다. Windows 런타임 지원을 사용하여 네이티브 시스템 Windows 런타임 API와 커스텀 .winmd 파일을 모두 관리된 코드(스크립트와 DLL)에서 직접 호출할 수 있습니다.
IL2CPP에서 Windows 런타임 지원을 자동으로 활성화하려면 Player 설정(Edit > Project Settings 로 이동한 다음 Player 카테고리 선택)으로 이동하여 Configuration 섹션에 액세스한 다음, Api Compatibility Level 을 .NET 4.6 또는 .NET Standard 2.0 으로 설정합니다.
Unity는 Windows Runtime 지원이 활성화된 경우 Windows Runtime API(유니버설 Windows 플랫폼의 Windows.winmd 등)를 자동으로 참조합니다. 커스텀 .winmd 파일을 사용하려면 (제공되는 모든DLL과 함께) Unity 프로젝트 폴더로 임포트한 다음 플러그인 인스펙터를 사용하여 파일을 대상 플랫폼에 맞게 설정합니다.
Unity 프로젝트의 스크립트에서 ENABLE_WINMD_SUPPORT
#define 지시문을 사용해 프로젝트에서 Windows Runtime 지원이 활성화되었는지 확인할 수 있습니다. 이 지시문을 실행하고 Windows와 관련이 없는 스크팁트에서 무시되도록 하려면 지시문을 .winmd Windows API 또는 커스텀 .winmd 스크립트 호출보다 먼저 사용합니다. 참고, 이 지시문은 C# 스크립트에서만 지원됩니다. 아래 예제를 참조하십시오.
예제
C#
void Start() {
#if ENABLE_WINMD_SUPPORT
Debug.Log("Windows Runtime Support enabled");
// Put calls to your custom .winmd API here
#endif
}
• 2017–05–16 페이지 수정됨
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.