fix for issues on ios
This commit is contained in:
parent
1cfa3630c0
commit
c9816b606a
|
@ -1,3 +1,11 @@
|
|||
## 0.1.6+8
|
||||
|
||||
* Breaking change for unityframework iOS
|
||||
|
||||
## 0.1.6+7
|
||||
|
||||
* Breaking change for unityframework iOS
|
||||
|
||||
## 0.1.6+6
|
||||
|
||||
* Breaking change for unityframework iOS
|
||||
|
|
|
@ -17,7 +17,7 @@ Flutter unity 3D widget for embedding unity in flutter. Now you can make awesome
|
|||
|
||||
```yaml
|
||||
dependencies:
|
||||
flutter_unity_widget: ^0.1.6+5
|
||||
flutter_unity_widget: ^0.1.6+8
|
||||
```
|
||||
|
||||
Now inside your Dart code you can import it.
|
||||
|
@ -84,6 +84,8 @@ Be sure you have at least one scene added to your build.
|
|||
**iOS Platform**:
|
||||
1. This only works with Unity version >=2019.3 because uses Unity as a library!
|
||||
2. Depending on where you want to test or run your app, (simulator or physical device), you should select the appropriate SDK on `Target SDK`.
|
||||
3. Add this to the flutter app Info.plist ```<key>io.flutter.embedded_views_preview</key>
|
||||
<true/>```
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
|
|
@ -11,8 +11,10 @@ static const int constsection = 0;
|
|||
|
||||
bool unity_inited = false;
|
||||
|
||||
// keep arg for unity init from non main
|
||||
int g_argc;
|
||||
char** g_argv;
|
||||
NSDictionary* appLaunchOpts;
|
||||
|
||||
void UnityInitTrampoline();
|
||||
|
||||
|
@ -38,17 +40,7 @@ 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;
|
||||
}
|
||||
|
||||
|
@ -61,8 +53,10 @@ 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];
|
||||
// [ufw setExecuteHeader: &_mh_execute_header];
|
||||
// [ufw runEmbeddedWithArgc: gArgc argv: gArgv appLaunchOpts: appLaunchOpts];
|
||||
}
|
||||
|
||||
extern "C" void UnityPostMessage(NSString* gameObject, NSString* methodName, NSString* message)
|
||||
|
|
|
@ -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: 0.1.6+6
|
||||
version: 0.1.6+8
|
||||
#authors:
|
||||
# - Rex Raphael <rex.raphael@outlook.com>
|
||||
# - Thomas Stockx <thomas@stockxit.com>
|
||||
|
|
Reference in New Issue