GameActivity에는 다음과 같은 종속성이 있습니다.
GameActivity는 CMake를 사용하여 빌드 프로세스 중에 브리지 코드(libgame.so
)를 생성합니다.
참고: 커스텀 Android SDK를 제공하는 경우 SDK에 CMake 3.22.1이 포함되어 있어야 합니다.
GameActivity에는 다음과 같은 AndroidX Gradle 종속성이 필요합니다.
androidx.appcompat:appcompat
androidx.games:games-activity
androidx.core:core
Androidx.constraintlayout
Gradle은 AndroidX 및 이러한 종속성을 자동으로 설치합니다.
GameActivity를 사용하는 경우 애플리케이션 플레이어 루프는 Java 스레드가 아닌 네이티브 스레드에서 실행됩니다. 따라서 플러그인에서 myLooper와 같은 Java API를 호출하면 실패하게 됩니다. myLooper
의 경우 네이티브 스레드에 Java 루퍼가 존재하지 않기 때문입니다. 또한 myLooper
와 같은 API를 사용하는 모든 API도 실패하게 됩니다. 예를 들어 registerInputDeviceListener는 핸들러가 null인 경우 실패합니다. Android 플러그인을 생성할 때 이러한 제한 사항을 이해하는 것이 중요합니다.
GameActivity를 사용하는 경우 Unity는 프레임 시간을 동기화하기 위해 NDK 코레오그래퍼를 사용하려고 합니다. 기기 API 레벨이 24보다 낮거나 애플리케이션이 32비트 플레이어를 사용하고 기기 API 레벨이 29보다 낮은 경우, Unity는 Java 코레오그래퍼를 사용합니다.
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.