Skip to content

Commit 91fdb73

Browse files
committed
Merge branch 'master' into null_safe
2 parents aee1c12 + 604b6a5 commit 91fdb73

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
Flutter unity 3D widget for embedding unity in flutter. Now you can make awesome gamified features of your app in Unity and get it rendered in a Flutter app both in fullscreen and embeddable mode. Works great on Android, iPad OS and iOS. There are now two unity app examples in the unity folder, one with the default scene and another based on Unity AR foundation samples.
1414
<br />
15-
Note: Supports only Unity 2019.4.3 or later
15+
Note: Supports only Unity 2019.4.3 or later. UnityFramework does not support emulator.
1616
<br />
1717

1818

android/src/main/kotlin/com/xraph/plugin/flutter_unity_widget/FlutterUnityWidgetPlugin.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class FlutterUnityWidgetPlugin : FlutterPlugin, ActivityAware {
101101
activity.application.registerActivityLifecycleCallbacks(this)
102102
}
103103

104-
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle) {
104+
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
105105
if (activity.hashCode() != registrarActivityHashCode) {
106106
return
107107
}

ios/Classes/UnityPlayerUtils.swift

+5-10
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ var sharedApplication: UIApplication?
8787
self.ufw = UnityFrameworkLoad()
8888

8989
self.ufw?.setDataBundleId("com.unity3d.framework")
90-
self.ufw?.register(self)
9190

9291
registerUnityListener()
9392
self.ufw?.runEmbedded(withArgc: gArgc, argv: gArgv, appLaunchOpts: appLaunchOpts)
@@ -141,21 +140,21 @@ var sharedApplication: UIApplication?
141140
}
142141
}
143142

144-
func unregisterUnityListener() {
143+
func registerUnityListener() {
145144
if self.unityIsInitiallized() {
146145
self.ufw?.register(self)
147146
}
148147
}
149148

150-
func registerUnityListener() {
149+
func unregisterUnityListener() {
151150
if self.unityIsInitiallized() {
152151
self.ufw?.unregisterFrameworkListener(self)
153152
}
154153
}
155-
156-
private func unityDidUnload(notification: Notification?) {
154+
155+
@objc
156+
public func unityDidUnload(_ notification: Notification!) {
157157
unregisterUnityListener()
158-
self.ufw?.unregisterFrameworkListener(self)
159158
self.ufw = nil
160159
self._isUnityReady = false
161160
self._isUnityLoaded = false
@@ -220,10 +219,6 @@ var sharedApplication: UIApplication?
220219
// Unoad unity player
221220
func unload() {
222221
self.ufw?.unloadApplication()
223-
unregisterUnityListener()
224-
self.ufw = nil
225-
self._isUnityReady = false
226-
self._isUnityLoaded = false
227222
}
228223

229224
func isUnityLoaded() -> Bool {

0 commit comments

Comments
 (0)