@@ -70,6 +70,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
70
70
71
71
/// Checks to see if unity player is ready to be used
72
72
/// Returns `true` if unity player is ready.
73
+ @override
73
74
Future <bool ?>? isReady () {
74
75
if (! _unityWidgetState.widget.enablePlaceholder) {
75
76
return UnityWidgetPlatform .instance.isReady (unityId: unityId);
@@ -79,6 +80,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
79
80
80
81
/// Get the current pause state of the unity player
81
82
/// Returns `true` if unity player is paused.
83
+ @override
82
84
Future <bool ?>? isPaused () {
83
85
if (! _unityWidgetState.widget.enablePlaceholder) {
84
86
return UnityWidgetPlatform .instance.isPaused (unityId: unityId);
@@ -88,6 +90,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
88
90
89
91
/// Get the current load state of the unity player
90
92
/// Returns `true` if unity player is loaded.
93
+ @override
91
94
Future <bool ?>? isLoaded () {
92
95
if (! _unityWidgetState.widget.enablePlaceholder) {
93
96
return UnityWidgetPlatform .instance.isLoaded (unityId: unityId);
@@ -97,6 +100,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
97
100
98
101
/// Helper method to know if Unity has been put in background mode (WIP) unstable
99
102
/// Returns `true` if unity player is in background.
103
+ @override
100
104
Future <bool ?>? inBackground () {
101
105
if (! _unityWidgetState.widget.enablePlaceholder) {
102
106
return UnityWidgetPlatform .instance.inBackground (unityId: unityId);
@@ -107,6 +111,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
107
111
/// Creates a unity player if it's not already created. Please only call this if unity is not ready,
108
112
/// or is in unloaded state. Use [isLoaded] to check.
109
113
/// Returns `true` if unity player was created succesfully.
114
+ @override
110
115
Future <bool ?>? create () {
111
116
if (! _unityWidgetState.widget.enablePlaceholder) {
112
117
return UnityWidgetPlatform .instance.createUnityPlayer (unityId: unityId);
@@ -121,6 +126,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
121
126
/// ```dart
122
127
/// postMessage("GameManager", "openScene", "ThirdScene")
123
128
/// ```
129
+ @override
124
130
Future <void >? postMessage (String gameObject, methodName, message) {
125
131
if (! _unityWidgetState.widget.enablePlaceholder) {
126
132
return UnityWidgetPlatform .instance.postMessage (
@@ -140,6 +146,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
140
146
/// ```dart
141
147
/// postJsonMessage("GameManager", "openScene", {"buildIndex": 3, "name": "ThirdScene"})
142
148
/// ```
149
+ @override
143
150
Future <void >? postJsonMessage (
144
151
String gameObject, String methodName, Map <String , dynamic > message) {
145
152
if (! _unityWidgetState.widget.enablePlaceholder) {
@@ -154,6 +161,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
154
161
}
155
162
156
163
/// Pause the unity in-game player with this method
164
+ @override
157
165
Future <void >? pause () {
158
166
if (! _unityWidgetState.widget.enablePlaceholder) {
159
167
return UnityWidgetPlatform .instance.pausePlayer (unityId: unityId);
@@ -162,6 +170,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
162
170
}
163
171
164
172
/// Resume the unity in-game player with this method idf it is in a paused state
173
+ @override
165
174
Future <void >? resume () {
166
175
if (! _unityWidgetState.widget.enablePlaceholder) {
167
176
return UnityWidgetPlatform .instance.resumePlayer (unityId: unityId);
@@ -171,6 +180,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
171
180
172
181
/// Sometimes you want to open unity in it's own process and openInNativeProcess does just that.
173
182
/// It works for Android and iOS is WIP
183
+ @override
174
184
Future <void >? openInNativeProcess () {
175
185
if (! _unityWidgetState.widget.enablePlaceholder) {
176
186
return UnityWidgetPlatform .instance.openInNativeProcess (unityId: unityId);
@@ -180,6 +190,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
180
190
181
191
/// Unloads unity player from th current process (Works on Android only for now)
182
192
/// iOS is WIP. For more information please read [Unity Docs] (https://docs.unity3d.com/2020.2/Documentation/Manual/UnityasaLibrary.html)
193
+ @override
183
194
Future <void >? unload () {
184
195
if (! _unityWidgetState.widget.enablePlaceholder) {
185
196
return UnityWidgetPlatform .instance.unloadPlayer (unityId: unityId);
@@ -188,6 +199,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
188
199
}
189
200
190
201
/// Quits unity player. Note that this kills the current flutter process, thus quiting the app
202
+ @override
191
203
Future <void >? quit () {
192
204
if (! _unityWidgetState.widget.enablePlaceholder) {
193
205
return UnityWidgetPlatform .instance.quitPlayer (unityId: unityId);
@@ -206,6 +218,7 @@ class MobileUnityWidgetController extends UnityWidgetController {
206
218
_onUnityUnloadedSub = null ;
207
219
}
208
220
221
+ @override
209
222
void dispose () {
210
223
_cancelSubscriptions ();
211
224
UnityWidgetPlatform .instance.dispose (unityId: unityId);
0 commit comments