You can enhance your existing apps by easily adding AR, real-time rendering, mini-games and more into your native mobile experience. Unity 2019.4 LTS adds support for using Unity as a Library controlled by Android/Java and iOS/Objective C apps.
As we announced last June, Unity is creating solutions for developers who want to include features powered by Unity while making apps for Android with Java or for iOS with Objective C. With Unity 2019.4, you can integrate both the Unity runtime and your content to run inside a “native” platform app on iOS/Android using Unity as a Library. This means that you can now insert features such as augmented reality (AR), 3D/2D real-time rendering, 2D mini-games, and more directly into your mobile apps.
How it works
Unity offers controls that let you manage when and how to load/activate/unload the runtime library within your native application. Beyond that, the mobile app build process mostly stays the same. Check out our documentation for more detailed information and project samples for both Android and iOS.
Please note that using Unity as a Library requires that you deeply understand the architecture of Android/Java and iOS/Objective C applications.
A closer look at the AR scenario
Unity as a Library offers tremendous benefits for a variety of use cases across industries, but it’s particularly useful for inserting AR experiences into existing mobile apps. To see this feature in action, check out the Unite Copenhagen 2019 session about the development of IKEA’s AR-enhanced IKEA Place mobile app, “Inserting AR directly into a native mobile app.”
We also made this short AR-based demo to show you see how easy it is to integrate and edit AR elements.
You can find the source code for that AR sample here.
Beyond mobile
While this capability is new for mobile platforms, you can already harness the power of embedding Unity as a Library for Windows and the Universal Windows Platform. You can find more details in our documentation.
Unlock new possibilities in your app by using Unity as a Library.
Родственные публикации
Comments are closed.
11 replies on “Add Unity-powered features to your app using Unity as a Library”
Adding xamarin support would be a HUGE plus. With how already multi-platform unity & xamarin are it would be great to add unity into xamarin projects
Can you make mobile apps with Unity?
Does this work with swift code, or do I have to build a swift to objectiveC to c++ to Unity bridge?
We have not done any extensive testing with Swift or SwiftUI and we are looking into this. We don’t have any timeline yet on when we can confidently support these scenarios. However, we’ve seen users experimenting with Swift/SwiftUI starting from the objectiveC sample and bridge. Please share you experience/questions in the iOS related forum: https://forum.unity.com/forums/ios-and-tvos.27/
The docs don’t really mention what kind of impact this has on performance, and what kind of constraints there are in terms of e.g. rendering technologies.
Will both the «parent» app and the Unity code be in memory? Are there ways to reduce that impact?
Is it possible to use UaaL in an Android VR context (e.g. for Quest)?
Is it possible to use UaaL from inside another Unity application?
For current supported use cases, Unity runtime is full screen and has the focus (native controls can be overlayed). The host application should be idle, and if it is, it should not have any significant performance impact on Unity. The host app will always remain in memory and in most scenario once you’ve loaded the Unity runtime, even after «Unload» it will keep at minimum a memory footprint at ~ 100Mb (as mentioned in the docs), so it can resume fast when called again.
We have not tested with Quest. Although it’s Android based, Quest has its specificities.
Unity as a Library is supported for Mobile Android as defined in the System Requirements:
https://docs.unity3d.com/2019.3/Documentation/Manual/system-requirements.html#mobile.
Finally, no «inception» scenario where you’d be running Unity inside Unity is supported ;-)
Is there additional license and COST to using the Unity runtime as a library? If so where is that information, is there a per install fee?
There is no additional license terms when using Unity this way. The same general terms of service (https://unity3d.com/legal/terms-of-service/software) and Unity Pro, Plus, Personal software (https://unity3d.com/legal/terms-of-service/software) apply.
Wait, I’m a bit confused. What’s now new in this blogpost? This has been around for some time now right?
Hello,
the feature is not new but last announcement was in June last year when it was Beta, so we wanted to highlight it now that it’s been available with 2019LTS, and we also produced the new AR sample linked in the post — which is a very common scenario for Unity as a Library use case.
I think it’s an amazing feature, but not many people know about it