{"id":19643874,"url":"https://github.com/duzexu/use-unity-as-library","last_synced_at":"2025-07-31T14:34:10.767Z","repository":{"id":70340994,"uuid":"265789186","full_name":"duzexu/Use-Unity-as-Library","owner":"duzexu","description":"将Unity以库形式集成到原生iOS","archived":false,"fork":false,"pushed_at":"2021-10-26T08:26:50.000Z","size":1805,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T13:34:02.474Z","etag":null,"topics":["ios","swift","unity"],"latest_commit_sha":null,"homepage":"https://duzexu.github.io/post/Use_Unity_as_Library/","language":"Objective-C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/duzexu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-21T07:56:56.000Z","updated_at":"2024-03-04T06:20:18.000Z","dependencies_parsed_at":"2023-02-23T20:01:10.398Z","dependency_job_id":null,"html_url":"https://github.com/duzexu/Use-Unity-as-Library","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/duzexu/Use-Unity-as-Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duzexu%2FUse-Unity-as-Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duzexu%2FUse-Unity-as-Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duzexu%2FUse-Unity-as-Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duzexu%2FUse-Unity-as-Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/duzexu","download_url":"https://codeload.github.com/duzexu/Use-Unity-as-Library/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/duzexu%2FUse-Unity-as-Library/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268057201,"owners_count":24188616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ios","swift","unity"],"created_at":"2024-11-11T14:24:25.140Z","updated_at":"2025-07-31T14:34:10.752Z","avatar_url":"https://github.com/duzexu.png","language":"Objective-C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unity as a Library integration example to iOS and Android #\n\nIn some scenario developers using native platform technologies (like Android/Java \u0026 iOS/Objective C) want to include in their apps/games features powered by Unity for 3D/2D Real Time Rendering, AR experience, interaction with 3D models, 2D mini games and more.\n\nStarting with Unity 2019.3.0a2, Unity  introduced a new feature to use Unity as a library in native apps by integrating the Unity runtime components and content in a native platform project. The Unity Runtime Library exposes controls to manage when and how to load/activate/unload within the native application.\n\n**Limitations**\nWhile we tested many scenarios for Unity as a library hosted by a native app, Unity does not control anymore the lifecycle of the runtime, so we cannot guarantee it'll work in all possible use cases. \nFor example:\n- Unity as a Library supports rendering only full screen, rendering on a part of the screen isn’t supported.\n- Loading more than one instance of the Unity runtime isn’t supported.\n- You may need to adapt 3rd party Plug-ins (native or managed) to work properly  \n- Overhead of having Unity in unloaded state is: 90Mb for Android and 110Mb for iOS\n\n**How it works**\nThe build process overall is still the same, Unity creates the iOS Xcode and Android Gradle projects and generated iOS Xcode and Android Gradle projects have the following structure:\n A library part (iOS framework and Android Archive (AAR) file) that includes all source \u0026 plugins \n A thin launcher part that includes app representation data and runs library\n\nStep by step explanations on how to include the [iOS](docs/ios.md) / [Android](docs/android.md) library part into your native application when needed.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduzexu%2Fuse-unity-as-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fduzexu%2Fuse-unity-as-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fduzexu%2Fuse-unity-as-library/lists"}