Search Unity

Unity 2019.3부터 Unity를 기본 Android/Java 및 iOS/Objective C 애플리케이션이 제어하는 라이브러리로 사용할 수 있도록 지원합니다. 이를 통해 AR 및 기타 Unity 기능을 애플리케이션에 쉽게 추가할 수 있습니다.

기본 플랫폼 기술(Android/Java, iOS/Objective C 등)을 사용하는 개발자도 Unity에서 제공하는 기능을 애플리케이션과 게임에 추가하고자 하는 경우가 있습니다. Unity 2019.3.a2부터는 Unity 런타임 컴포넌트와 콘텐츠를 기본 플랫폼 프로젝트로 통합하여 Unity를 라이브러리로 사용할 수 있습니다.

즉, 증강 현실(AR), 3D/2D 실시간 렌더링, 2D 미니 게임과 같은 Unity 기반의 기능을 기본 모바일 애플리케이션에 직접 추가할 수 있습니다.

원리: 프로젝트 구조의 변경

Unity 런타임 라이브러리는 기본 애플리케이션 내에서 로드/활성화/언로드하는 시기와 방법을 관리하기 위한 컨트롤을 제공합니다.

전체적인 모바일 애플리케이션 빌드 프로세스는 동일하며, Unity에서 iOS Xcode 및 Android Gradle 프로젝트를 생성합니다.

하지만 이 기능을 사용하기 위해서 Unity로 생성된 iOS Xcode 및 Android Gradle 프로젝트의 구조를 다음과 같이 변경하였습니다.

  • 모든 소스 파일과 플러그인을 포함하는 라이브러리 부분(iOS 프레임워크 및 AAR(Android Archive) 파일)
  • 애플리케이션 표현 데이터를 포함하고 라이브러리 부분을 실행하는 씬 런처(thin launcher) 부분

Xcode/Android Gradle 프로젝트의 변경 사항에 대한 자세한 내용은 포럼 게시글에서 확인할 수 있습니다.

또한 기본 샘플 프로젝트를 포함하여 iOS 및 Android에서 Unity를 라이브러리로 통합하는 방법에 대한 단계별 지침을 제공합니다.

참고로, Unity 라이브러리로 사용하려면 Android/Java iOS/Objective C 애플리케이션의 아키텍처를 알아야 합니다.

제한 사항

Unity를 기본 애플리케이션에서 호스팅되는 라이브러리로 사용하는 여러 시나리오를 테스트했습니다. 그러나 Unity 이상 런타임의 라이프 사이클을 제어하지 않기 때문에 적용했을 원활히 작동하지 않을 수도 있습니다. 그 예로 다음과 같은 사례가 있습니다.

  • Unity를 라이브러리로 사용하는 경우 전체 화면 렌더링만 가능하며, 화면 일부를 렌더링하는 것은 지원되지 않습니다.
  • Unity 런타임 인스턴스를 2개 이상 로드할 수 없습니다.
  • 제대로 작동하기 위해서는 타사 플러그인(기본또는 관리형)을 적용해야 할 수도 있습니다.

 

최신 기술을 활용한 혁신적인 마케팅 캠페인

Unity를 라이브러리로 사용할 수 있게 됨으로써 다양한 산업 분야의 수많은 사용 사례에 적용할 수 있게 되어 굉장한 이점을 안겨줍니다. 특히 브랜드 및 크리에이티브 에이전시의 경우 AR을 기본 모바일 애플리케이션에 간편하게 바로 추가할 수 있습니다.

최신 기술을 활용하는 브랜드의 경우 기존의 마케팅 캠페인에 AR 기술을 더했을 때 기대할 수 있는 가치를 잘 알고 있습니다. 또한 Unity를 라이브러리로 사용하면 프로세스가 간소화됩니다. 브랜드 및 크리에이티브 에이전시는 AR을 구현하기 위해 애플리케이션을 다시 빌드하거나, Unity를 라이브러리로 사용하기 위해 솔루션을 만들 필요가 없습니다.

AR 마케팅에 대해 소비자는 호의적이며, 브랜드는 AR을 통해 소비자와 밀접한 관계를 형성할 수 있습니다. 유니티는 마케팅의 발전을 촉진하는 이러한 솔루션을 제공하게 되어 매우 기쁘게 생각합니다.

브랜드 및 크리에이티브 에이전시에서 어떤 방식으로 Unity를 활용하고 있는지 자세히 알아보려면 솔루션 페이지를 확인해 보세요.

32 코멘트

코멘트 구독

코멘트를 달 수 없습니다.

  1. I tried unity as a plugin for android. When I am using the AR camera, it is giving me the error android_unity_bridge class error in android studio. Do you have any documentation for AR using unity as a plugin for android and ios(SWIFT)

    1. Hi Jibin,
      we are working on a sample that demonstrate a native app + a Unity AR experience. Stay tuned.
      However for iOS, we won’t be supporting SWIFT for now, our focus in on Objective C.
      JC

  2. > Unity as a Library supports full-screen rendering only; rendering on only a part of the screen is not supported.

    Not supported as in “and will never be” or as in “but will be in the future”? :D

    1. Hi David,
      Not supported for now.
      We are considering it but it’s a tricky scenario where Unity needs to share resources with the native app. We don’t have a timeline yet, and are looking for feedback on what scenario make sense for you.
      Please jump on the forum post to share ideas.
      JC

  3. It would interesting to have it running under a Cordova hibrid App

  4. I can use this for AR in a lot of my applications so I’m excited! My only request is please release a tutorial or youtube video on an example of how to put this together as it might be a bit confusing doing guesswork once it releases.

    1. we are making more samples but the one shared on the forum linked in this blog post should give you all the building block you need.
      don’t forget, as I wrote:
      “Please note that using Unity as a library requires that you deeply understand the architecture of Android/Java and iOS/Objective C applications.”

  5. Honestly, this was a lot more impressive until I saw “supports full-screen rendering only.” Really, every potential idea I had up until that point was cast aside.

    1. Hi Liz,
      Please share your ideas on the forum. we are listening ;-)
      As responded on another similar question:
      We are considering it but it’s a tricky scenario where Unity needs to share resources with the native app. We don’t have a timeline yet, and are looking for feedback on what scenario make sense for you.

  6. Could I write a Apple Watch app with Unity with this change?

    Like running the engine on the watch itself without a phone companion. Ideally I’d like my game to run both the watch and my phone so I can have a shared codebase.

    1. Hi,
      No, Unity does not support Watch OS, and no plan for now.

  7. Thank you for sharing this good information. Mobile Application Development is an interesting field. Our website have many packages about App Development. You can visit:
    App Development Packages

  8. Is it planed to be just for mobile?
    It could be amazing to use Unity rendering capabilities as a runtime for native desktop apps.
    I’m thinking in the direction of embedding Unity as a set of nodes for TouchDesigner for example.

  9. Gregory Pierce

    6월 18, 2019 3:44 오전

    Unity, just go ahead and build us something for Python. The ML interface is Python, the new UI scripting stuff supports python – just go ahead and give us python support @ the engine and be done with it :)

    1. Using Python would violate the Performance by Default goal.

    2. Aside from the terrible performance implications, why would you actually need this? C# really is not that hard to learn and write. You use the right tools for the right job. Python is used for machine learning because its an industry standard and performs well for AI. The same cant be said about python and the rest of use cases, so really putting it for the rest of the engine just takes us back to the point we were with javascript.

      If you to write in python, why not just move to an actual python based graphics engine?

      1. Gregory Pierce

        6월 18, 2019 8:40 오후

        Because Unity has made a mission of making Unity a platform for more than just games. So while it is true that for regular games it would be a problematic issue – for other use cases (including as a teaching environment), Python would be excellent.

        1. They used to have Boo script, ie it was “python” the same way that unityscript was “javascript”

    3. Hi Gregory,
      if you care about Python for ML scenarios, please check “Unity ML Agents”:
      https://unity3d.com/machine-learning
      Unity Machine Learning Agents, the first of Unity’s machine learning product offerings, trains intelligent agents with reinforcement learning and evolutionary methods via a simple Python API.
      We don’t plan to add any new language to Unity for now. C# it is.

      1. Gregory Pierce

        6월 20, 2019 8:47 오전

        Certainly JC, that’s where I currently interface with Unity for a number of RL things. Even tried to build something with IronPython a while back because Python is a good teaching/learning language. But I know you guys are busy rebuilding pretty much all of the Unity that I used to know (and that’s a good thing), so maybe when you’re done with that ;)

  10. Can’t wait for a python interface! it would be great for machine learning research projects!

    1. look at “Unity ML Agents”:
      https://unity3d.com/machine-learning
      Unity Machine Learning Agents, the first of Unity’s machine learning product offerings, trains intelligent agents with reinforcement learning and evolutionary methods via a simple Python API.

  11. this one is cool i really love these updates by Unity, i have a past of game development but now i am an full time app developer at https://appdevelopmentagency.com.au/. working in a professional environment boosts my creativity i am a fan of Unity.

  12. Any word on how big the framework and aar will be for an empty project?

    1. You can consider that the size of the final binary is the same than a normal Unity project.

  13. Now, this would also be great on PC. We currently prototype the integration of Unity in a WPF application and had to setup a client/server structure to handle communication between the app and Unity…

    1. @Stefan Maton @Unity

      For some of our projects, we have implemented the same type of TCP communication protocol between a Unity application and a WPF / WinForm application. With the addition of the management of the inclusion of a Unity window in a WPF / WinForm Panel (SetParent, …). This works well but it would be comfortable to have native support for this type of integration.

      1. It would certainly be great to have an easier integration of Unity into desktop apps too, e.g. Qt programs. Currently, we have a setup that uses some shared memory and communicates over a lot of callbacks. But this is super cumbersome.

    2. This is in fact already possible for PC, and has been for some time now, though admittedly it isn’t well documented. We are planning to include documentation for how to embed Unity as a library for desktop platforms soon. Stay tuned.