From 93fcb3eaf78d40770d728637c73103148831b00c Mon Sep 17 00:00:00 2001 From: rexraphael Date: Wed, 31 Aug 2022 21:20:48 +0200 Subject: [PATCH 1/6] feat: bumped to flutter 3.3.0 --- README.md | 2 +- example/lib/screens/simple_screen.dart | 2 +- .../unity/DemoApp/Assets/StreamingAssets.meta | 8 ------- example/unity/DemoApp/Packages/manifest.json | 6 ++--- .../unity/DemoApp/Packages/packages-lock.json | 8 +++---- .../ProjectSettings/ProjectSettings.asset | 4 ++-- .../ProjectSettings/ProjectVersion.txt | 4 ++-- ios/Classes/UnityPlayerUtils.swift | 2 -- lib/src/io/device_method.dart | 23 +++++++++---------- pubspec.yaml | 4 ++-- 10 files changed, 26 insertions(+), 37 deletions(-) delete mode 100644 example/unity/DemoApp/Assets/StreamingAssets.meta diff --git a/README.md b/README.md index 758c2d71..f95e0d04 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ First depend on the library by adding this to your packages `pubspec.yaml`: - Flutter 3.0.0 ```yaml dependencies: - flutter_unity_widget: ^2022.1.1+3 + flutter_unity_widget: ^2022.2.0 ``` diff --git a/example/lib/screens/simple_screen.dart b/example/lib/screens/simple_screen.dart index d4ceada9..20ec44d6 100644 --- a/example/lib/screens/simple_screen.dart +++ b/example/lib/screens/simple_screen.dart @@ -46,7 +46,7 @@ class _SimpleScreenState extends State { onUnityCreated: _onUnityCreated, onUnityMessage: onUnityMessage, onUnitySceneLoaded: onUnitySceneLoaded, - useAndroidViewSurface: true, + useAndroidViewSurface: false, borderRadius: BorderRadius.all(Radius.circular(70)), ), PointerInterceptor( diff --git a/example/unity/DemoApp/Assets/StreamingAssets.meta b/example/unity/DemoApp/Assets/StreamingAssets.meta deleted file mode 100644 index e449ffb7..00000000 --- a/example/unity/DemoApp/Assets/StreamingAssets.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 271a81e724aca4d129fc120800500931 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/example/unity/DemoApp/Packages/manifest.json b/example/unity/DemoApp/Packages/manifest.json index 1be7d3a3..3b181e8c 100644 --- a/example/unity/DemoApp/Packages/manifest.json +++ b/example/unity/DemoApp/Packages/manifest.json @@ -1,9 +1,9 @@ { "dependencies": { - "com.unity.collab-proxy": "1.15.18", + "com.unity.collab-proxy": "1.17.1", "com.unity.ext.nunit": "1.0.6", - "com.unity.ide.rider": "3.0.14", - "com.unity.ide.visualstudio": "2.0.15", + "com.unity.ide.rider": "3.0.15", + "com.unity.ide.visualstudio": "2.0.16", "com.unity.ide.vscode": "1.2.5", "com.unity.test-framework": "1.1.31", "com.unity.textmeshpro": "3.0.6", diff --git a/example/unity/DemoApp/Packages/packages-lock.json b/example/unity/DemoApp/Packages/packages-lock.json index 4c7bc065..17d3b455 100644 --- a/example/unity/DemoApp/Packages/packages-lock.json +++ b/example/unity/DemoApp/Packages/packages-lock.json @@ -1,7 +1,7 @@ { "dependencies": { "com.unity.collab-proxy": { - "version": "1.15.18", + "version": "1.17.1", "depth": 0, "source": "registry", "dependencies": { @@ -24,7 +24,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.rider": { - "version": "3.0.14", + "version": "3.0.15", "depth": 0, "source": "registry", "dependencies": { @@ -33,7 +33,7 @@ "url": "https://packages.unity.com" }, "com.unity.ide.visualstudio": { - "version": "2.0.15", + "version": "2.0.16", "depth": 0, "source": "registry", "dependencies": { @@ -56,7 +56,7 @@ "url": "https://packages.unity.com" }, "com.unity.services.core": { - "version": "1.4.0", + "version": "1.4.2", "depth": 1, "source": "registry", "dependencies": { diff --git a/example/unity/DemoApp/ProjectSettings/ProjectSettings.asset b/example/unity/DemoApp/ProjectSettings/ProjectSettings.asset index c14fa22d..3a94e742 100644 --- a/example/unity/DemoApp/ProjectSettings/ProjectSettings.asset +++ b/example/unity/DemoApp/ProjectSettings/ProjectSettings.asset @@ -139,8 +139,8 @@ PlayerSettings: Others: 1 bundleVersion: 0.1 preloadedAssets: - - {fileID: 4800000, guid: e7c77f6eaab324a819efdc13b8125a39, type: 3} - - {fileID: -5691617579673776505, guid: 1356279c9d721447b97eebba41ddf775, type: 2} + - {fileID: 4800000, guid: c9f956787b1d945e7b36e0516201fc76, type: 3} + - {fileID: 673190512444688615, guid: 1356279c9d721447b97eebba41ddf775, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1 diff --git a/example/unity/DemoApp/ProjectSettings/ProjectVersion.txt b/example/unity/DemoApp/ProjectSettings/ProjectVersion.txt index fadb13a3..a68fd91b 100644 --- a/example/unity/DemoApp/ProjectSettings/ProjectVersion.txt +++ b/example/unity/DemoApp/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 2022.1.7f1 -m_EditorVersionWithRevision: 2022.1.7f1 (240f4c1f462c) +m_EditorVersion: 2022.1.13f1 +m_EditorVersionWithRevision: 2022.1.13f1 (22856944e6d2) diff --git a/ios/Classes/UnityPlayerUtils.swift b/ios/Classes/UnityPlayerUtils.swift index f09c45c1..ef055942 100755 --- a/ios/Classes/UnityPlayerUtils.swift +++ b/ios/Classes/UnityPlayerUtils.swift @@ -251,7 +251,6 @@ var sharedApplication: UIApplication? /// the controller handler methods @objc func unityMessageHandlers(_ message: UnsafePointer?) { - for c in globalControllers { if let strMsg = message { c.handleMessage(message: String(utf8String: strMsg) ?? "") @@ -259,7 +258,6 @@ var sharedApplication: UIApplication? c.handleMessage(message: "") } } - } func unitySceneLoadedHandlers(name: UnsafePointer?, buildIndex: UnsafePointer?, isLoaded: UnsafePointer?, isValid: UnsafePointer?) { diff --git a/lib/src/io/device_method.dart b/lib/src/io/device_method.dart index 33c2746d..997614f0 100644 --- a/lib/src/io/device_method.dart +++ b/lib/src/io/device_method.dart @@ -169,18 +169,17 @@ class MethodChannelUnityWidget extends UnityWidgetPlatform { } if (defaultTargetPlatform == TargetPlatform.android) { - // commented for 3.0.0 changes in platform view rendition - // if (!useAndroidViewSurface) { - // return AndroidView( - // viewType: _viewType, - // onPlatformViewCreated: onPlatformViewCreated, - // gestureRecognizers: gestureRecognizers, - // creationParams: creationParams, - // creationParamsCodec: const StandardMessageCodec(), - // hitTestBehavior: PlatformViewHitTestBehavior.opaque, - // layoutDirection: TextDirection.ltr, - // ); - // } + if (!useAndroidViewSurface) { + return AndroidView( + viewType: _viewType, + onPlatformViewCreated: onPlatformViewCreated, + gestureRecognizers: gestureRecognizers, + creationParams: creationParams, + creationParamsCodec: const StandardMessageCodec(), + hitTestBehavior: PlatformViewHitTestBehavior.opaque, + layoutDirection: TextDirection.ltr, + ); + } return PlatformViewLink( viewType: _viewType, diff --git a/pubspec.yaml b/pubspec.yaml index 9eb39168..e6adbc5d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_unity_widget description: Flutter Unity 3D widget for embedding Unity game scenes in flutter. This library now supports Unity as a Library. -version: 2022.1.7+1 +version: 2022.2.0 #authors: # - Rex Raphael # - Thomas Stockx @@ -9,7 +9,7 @@ homepage: https://github.com/juicycleff/flutter-unity-view-widget/tree/master environment: sdk: ">=2.16.0 <3.0.0" - flutter: ">=3.0.0" + flutter: ">=3.3.0" dependencies: flutter: From 4d0f17acb1670f99340a1c8d036751d3dad47207 Mon Sep 17 00:00:00 2001 From: rexraphael Date: Wed, 31 Aug 2022 21:24:12 +0200 Subject: [PATCH 2/6] feat: bumped to flutter 3.3.0 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index e6adbc5d..fe201e64 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: plugin_platform_interface: ^2.1.2 webview_flutter: ^2.8.0 webviewx: ^0.2.1 - ffi: ^1.2.1 +# ffi: ^1.2.1 // required for windows support dev_dependencies: flutter_test: From 2ac9fcd7139b78d6988558d71cfa131131056566 Mon Sep 17 00:00:00 2001 From: rexraphael Date: Wed, 31 Aug 2022 21:24:52 +0200 Subject: [PATCH 3/6] chore: removed webview_flutter --- pubspec.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index fe201e64..cb6161e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,6 @@ dependencies: flutter_plugin_android_lifecycle: ^2.0.7 stream_transform: ^2.0.0 plugin_platform_interface: ^2.1.2 - webview_flutter: ^2.8.0 webviewx: ^0.2.1 # ffi: ^1.2.1 // required for windows support From c589f4d7cfb7ad54ab3ab83b2ef78f31582f9d96 Mon Sep 17 00:00:00 2001 From: rexraphael Date: Thu, 1 Sep 2022 12:32:51 +0200 Subject: [PATCH 4/6] chore: bumped flutter ci version --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 960a0997..ea85b199 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,7 +11,7 @@ jobs: - uses: subosito/flutter-action@v2 with: - flutter-version: '3.0.0' + flutter-version: '3.3.0' channel: 'stable' - name: Clean Dependencies From fe6c15a1d5a44f681ebc1d91644ba25a6c7d8cb6 Mon Sep 17 00:00:00 2001 From: rexraphael Date: Thu, 1 Sep 2022 12:38:48 +0200 Subject: [PATCH 5/6] chore: updated CHANGELOG.md --- .all-contributorsrc | 2 +- CHANGELOG.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index a53cbac5..37b06540 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,6 +1,6 @@ { "projectName": "flutter-unity-view-widget", - "projectOwner": "snowballdigital", + "projectOwner": "juicycleff", "repoType": "github", "repoHost": "https://github.com", "files": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index 03cd7f41..499bf44e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2022.2.0 + +* Enable AndroidView due to native view improvement in flutter 3.3.0 + ## 2022.1.7+1 * **BREAKING-CHANGE**: From 79fba147ddc05e210e39c02552de0fd1f7649186 Mon Sep 17 00:00:00 2001 From: rexraphael Date: Thu, 1 Sep 2022 12:46:32 +0200 Subject: [PATCH 6/6] ci: fixed tests --- test/flutter_unity_widget_test.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/flutter_unity_widget_test.dart b/test/flutter_unity_widget_test.dart index 4c514838..f4f8248e 100644 --- a/test/flutter_unity_widget_test.dart +++ b/test/flutter_unity_widget_test.dart @@ -79,8 +79,7 @@ Future main() async { ), ); - expect(find.byType(PlatformViewLink), findsOneWidget); - // expect(find.byType(AndroidView), findsOneWidget); + expect(find.byType(AndroidView), findsOneWidget); expect(find.byType(UnityWidget), findsOneWidget); }, );