Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Use Unity as a Library in other applications

Integrate Unity as a Library in other applications for platforms that support this feature, and learn about the known limitations.
Read time 2 minutesLast updated 13 days ago

Use Unity as a Library to insert Unity-powered features into applications built with native platform languages, such as Java, Swift, or C++.
You can integrate your content and the Unity runtime components in native platform projects. This allows you to embed content that uses 3D or 2D real-time rendering, like AR experiences, interaction with 3D models, and 2D mini-games. The Unity Runtime Library exposes ways to manage loading, activating, and unloading within the native application.

Prerequisites

You must have experience developing for native platform technologies such as Java/Android, Objective C/iOS, or Windows Win32/UWP. You also need familiarity with the project structure, language features, and specific platform configuration options, such as user permissions.

Supported platforms

The following platforms currently support Unity as a Library:
To determine platform versions and other dependencies, refer to the system requirements page.

Limitations

When hosted by another application, Unity doesn't control the runtime lifecycle, so it might not work in all scenarios. Known limitations include:

General limitations**

  • You can't load or integrate more than one instance of the Unity runtime.
  • You might need to adapt your native and managed plug-ins to work properly with this feature.

Android and iOS

  • Unity supports only full-screen rendering. If you're a Unity Industry customer, these features and limitations differ.
  • When Unity is in an unloaded state (after you call
    Application.Unload
    ), it retains memory (between 80 and 180 MB) to instantly switch back and run again in the same process. The amount of retained memory depends on the device's graphics resolution.

iOS only

  • If the Unity runtime quits entirely (after you call
    Application.Quit
    ), you can't reload Unity again in the same app session.

Additional resources