In some scenarios, developers using native platform technologies such as Java/Android, Objective C/iOS, or Windows Win32/UWP, want to include Unity-powered features in their games or applications. These features might use 3D or 2D real-time rendering, like AR experiences, interaction with 3D models, 2D mini-games, and so on.
Starting with Unity 2019.3, you can use Unity as a Library in other applications by integrating your content and the Unity runtime components in a native platform project. The Unity Runtime Library exposes ways to manage loading, activating, and unloading within the native application.
以下平台目前支持“Unity 用作库”:
要确定平台版本和其他依赖项,请参阅系统要求页面。
由另一个应用程序托管时,Unity 不能控制运行时生命周期,因此可能无法在所有情况下都奏效。已知限制包括:
Application.Unload
之后)时,它将保留一些内存(100Mb 或更少),以便能够立即切回并在同一进程中再次运行。Application.Quit
后),无法在同一应用程序会话中重新加载 Unity。–