pubspec.yaml
file and add flutter_unity_widget to it under the dependencies section.flutter pub get
.
ORpubspec.yaml
.pubspec.yaml
.FlutterUnityPackage.unitypackage
if you don't see a FlutterUnityIntegration folder inside the ARwayKit-SDK project.Flutter/Export Android
(for Unity versions 2019.3 and up, which uses the new Unity as a Library export format), or Flutter/Export IOS
menu.Flutter/Export <Platform> plugin
as it was specially added to work with flutter_unity_cli
for larger projects.android/unityLibrary
.ios/UnityLibrary
.<Your Flutter Project>/android/settings.gradle
file:<Your Flutter Project>/android/app/build.gradle
file and add:UnityExport/build.gradle
. The code below use the debug
signConfig for all buildTypes, which can be changed as you well if you need specify signConfig.minifyEnabled true
and need to use UnityMessage in Flutter, please add proguard content below:AndroidManifest.xml
filemain.m
should look like this:Info.plist
file with the key io.flutter.embedded_views_preview
and the value YES
.fullscreen
(Enable or disable fullscreen mode on Android)disableUnload
(Disable unload on iOS when unload is called)pause()
(Use this to pause unity player)resume()
(Use this to resume unity player)unload()
(Use this to unload unity player)quit()
(Use this to quit unity player)postMessage(String gameObject, methodName, message)
(Allows you invoke commands in Unity from flutter)onUnityMessage(data)
(Unity to flutter binding and listener)onUnityUnloaded()
(Unity to flutter listener when unity is unloaded)onUnitySceneLoaded(String name, int buildIndex, bool isLoaded, bool isValid,)
(Unity to flutter binding and listener when a new scene is loaded)