unity_kit 1.0.1
unity_kit: ^1.0.1 copied to clipboard
Flutter plugin for Unity 3D integration — typed bridge, lifecycle management, and communication layer.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.1 - 2026-03-27 #
Fixed #
- iOS: Unity view re-navigation —
detachUnityView()now checkssuperview === selfbefore removing, preventing race conditions when a new container has already claimed the Unity view. - iOS: Rendering restart — added
restartRendering()toUnityPlayerManagerthat callsshowUnityWindow()after view reattachment, ensuring AR subsystems (e.g. Vuforia) reinitialize properly. - iOS: CocoaPods dangling symlink — podspec no longer uses
File.symlink?which returnstruefor dangling symlinks, causing CocoaPodsrealpathto fail with ENOENT. - Dart: Active view channel routing — all platform method calls now use
_activeViewIdinstead of hardcoded0, ensuring correct MethodChannel routing after Flutter navigation creates new platform views. - Added
registerViewChannel(int viewId)toUnityKitPlatform— automatically called when a new platform view is created on both Android (Hybrid Composition) and iOS (UiKitView).
1.0.0 - 2026-03-27 #
Changed #
- Stable release — API is now considered stable. Follows Semantic Versioning from this point.
_RoutedUnityMessagenow exposes logicalgameObject,method,type, anddataproperties matching the actual target (e.g.FlutterAddressablesManager), while routing throughFlutterBridge.ReceiveMessageat the native layer vianativeGameObject/nativeMethod.
Added #
UnityMessage.nativeGameObjectandUnityMessage.nativeMethodgetters for accessing the nativeUnitySendMessagetarget separately from the logical message properties.UnityAssetLoader.loadContentCatalogMessage— request Unity to load a remote content catalog by URL (Addressables).- "Why Addressables?" section in README — explains how dynamic content delivery keeps app size ~100 MB instead of 500 MB+.
Fixed #
- All 22 previously failing tests in
streaming/andloaders/now pass — routed messages correctly expose target info through standardUnityMessageproperties.
0.9.2 - 2026-03-18 #
Fixed #
- Android display bug: Unity view no longer renders on top of all Flutter widgets, covering the entire screen regardless of layout bounds (#1).
- Switched Android rendering from Virtual Display (
AndroidView) to Hybrid Composition (PlatformViewLink+initExpensiveAndroidView) for correct z-ordering and bounds clipping. - Applied
setZOrderOnTop(false)on Unity'sSurfaceViewafter attachment. - Added delayed re-focus (500ms) to ensure rendering starts after Hybrid Composition finishes surface setup.
- Switched Android rendering from Virtual Display (
Documentation #
- Added ARM64 export requirement to unity-export.md — exporting only ARMv7 causes Unity player to silently fail on arm64 devices.
- Added troubleshooting entry for "Unity view never loads on Android".
0.9.1 - 2026-02-20 #
Fixed #
- Fixed
.pubignoreexcludingmodels/directory from published package, causing 159 analysis errors on pub.dev. - Removed unused
connectivity_plusdependency.
0.9.0 - 2026-02-19 #
Added #
- Gesture controls for
UnityView(gestureRecognizersparameter). - CocoaPods support for iOS integration.
- Target frame rate configuration (
UnityConfig.targetFrameRate). - Touch event handling for Android and iOS.
- Flutter Android lifecycle integration.
- Core bridge:
UnityBridge,UnityBridgeImplwith typed messaging. - Lifecycle management: 6-state machine (
uninitialized→ready→paused→resumed→disposed). - Readiness guard: auto-queue messages until Unity is ready.
- Message batching (~16ms windows, coalescing).
- Message throttling (3 strategies:
drop,keepLatest,keepFirst). - Asset streaming: manifest-based, SHA-256 integrity, caching.
- Content downloading with exponential backoff.
- Addressables and AssetBundle loaders.
UnityViewwidget with platform views (Android HybridComposition + iOS UiKitView).UnityPlaceholderloading widget.UnityLifecycleMixinfor app pause/resume handling.- Typed exception hierarchy (
UnityKitException,BridgeException,CommunicationException,LifecycleException,EngineNotReadyException). UnityConfig,UnityMessage,SceneInfomodels.- Platform abstraction via
MethodChannel. - C# Unity scripts (
FlutterBridge,MessageRouter,MessageBatcher,SceneTracker,NativeAPI,FlutterMonoBehaviour). - Comprehensive test suite (35 files, ~9000 lines).
- API documentation and asset streaming guide.