diff --git a/CHANGELOG.md b/CHANGELOG.md index 667b7b0..1a6b48c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.6+6 + +* Breaking change for unityframework iOS + ## 0.1.6+5 * Reworked onUnityMessage for iOS [@krispypen](https://github.com/krispypen) diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies new file mode 100644 index 0000000..e6ba6b6 --- /dev/null +++ b/example/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"flutter_unity_widget","dependencies":[]}]} \ No newline at end of file diff --git a/ios/Classes/UnityUtils.mm b/ios/Classes/UnityUtils.mm index 0496f32..ad365a2 100644 --- a/ios/Classes/UnityUtils.mm +++ b/ios/Classes/UnityUtils.mm @@ -38,7 +38,17 @@ UnityFramework* UnityFrameworkLoad() NSBundle* bundle = [NSBundle bundleWithPath: bundlePath]; if ([bundle isLoaded] == false) [bundle load]; + UnityFramework* ufw = [bundle.principalClass getInstance]; + if (![ufw appController]) + { + // Initialize Unity for a first time + [ufw setExecuteHeader: &_mh_execute_header]; + + // Keep in sync with Data folder Target Membership setting + [ufw setDataBundleId: "com.unity3d.framework"]; + + } return ufw; } @@ -51,8 +61,8 @@ extern "C" void InitUnity() ufw = UnityFrameworkLoad(); - [ufw setDataBundleId: "com.unity3d.framework"]; - [ufw frameworkWarmup: g_argc argv: g_argv]; + // [ufw setDataBundleId: "com.unity3d.framework"]; + // [ufw frameworkWarmup: g_argc argv: g_argv]; } extern "C" void UnityPostMessage(NSString* gameObject, NSString* methodName, NSString* message) diff --git a/pubspec.yaml b/pubspec.yaml index 58e85b6..e645b4c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,10 +1,10 @@ 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: 0.1.6+5 -authors: - - Rex Raphael - - Thomas Stockx - - Kris Pypen +version: 0.1.6+6 +#authors: +# - Rex Raphael +# - Thomas Stockx +# - Kris Pypen homepage: https://github.com/snowballdigital/flutter-unity-view-widget/tree/master environment: