-
Notifications
You must be signed in to change notification settings - Fork 19
Upgrading the Unity Plugin to a newer version
With the airconsole-unity-plugin 2.6.0 we introduce new capabilities and Assembly Definitions. Due to that, we needed to update the folder structure and code locations, an operation Unity Packages are not able to automatically take care of.
If you use Unity 2019, 2020 or 2021, you will need to update the project to an actively supported Unity LTS version (Unity 2022.3 or Unity 6+) to use the AirConsole plugin.
Note: With Unity 2019 no longer supported, you can also remove the Assets/WebGLTemplates/Airconsole
template if it still is in your project.
If you moved Assets/AirConsole
to a different location, ensure it is located at Assets/AirConsole
or complete deleted. Starting with v2.6.0 of the plugin, the tooling expects the AirConsole plugin to be found in Assets/AirConsole
. If it doesn't, the plugin will stop to work.
Search for a script usage like src="https://www.airconsole.com/api/airconsole-1.8.0.js"
, src="https://www.airconsole.com/api/airconsole-1.9.0.js"
or src="https://www.airconsole.com/api/airconsole-latest.js"
in your controller and replace it with src="https://www.airconsole.com/api/airconsole-1.10.0.js"
If you use Assembly Definitions for your own code, you will need to reference AirConsole.Runtime as a dependency for your project to compile again.
4. If you do not have any custom additions to the AndroidManifest or gradle files, you can delete Assets/Plugins/Android
.
AirConsole now ensures that the build gets correctly prepared and configured with the AirConsole requirements for TV and Automotive platforms independent of the initial state of these files.
You need to copy the correct version from WebGLTemplates/AirConsole
for Unity 2019 and below or WebGLTemplates/AirConsole-2020
for Unity 2020+ to the WebGLTemplate folder you use.
Open your controller's html file as well as the index.html in your WebGL template and search for <script src="translation.js"></script>
and replace it with <script src="airconsole-settings.js"></script>
, otherwise neither Translations nor Player Silencing will work.
Search for a script usage like <script src="https://www.airconsole.com/api/airconsole-1.8.0.js"></script>
and replace it with <script src="https://www.airconsole.com/api/airconsole-1.9.0.js"></script>
1. Replace AirConsole.instance.devices with AirConsole.instance.Devices
2. Replace AirConsole.instance.device_id with AirConsole.instance.GetDeviceId()
3. Replace AirConsole.instance.server_time_offset with AirConsole.instance.GetServerTime()
The location of the Webview has changed in this release.
When upgrading from v2.11 and before, you need manually remove the old Webview plugin parts:
Assets/AirConsole/plugins/WebViewObject.cs
Assets/AirConsole/plugins/Editor/UnityWebViewPostprocessBuild.cs
Assets/AirConsole/plugins/WebView.bundle
Assets/AirConsole/plugins/WebViewSeparated.bundle
Assets/AirConsole/plugins/Anrdoid/WebViewPlugin.jar
Assets/AirConsole/plugins/iOS/WebView.mm
Assets/AirConsole/plugins/X86_64/WebView.bundle
With v2.11, the AirConsole.instance.OnMute
event was removed and the AirConsole platform stopped invoking it for older projects in July 2023.
When upgrading you need to update your event handlers for AirConsole.instance.OnAdShow
and AirConsole.instance.OnAdComplete
to take care of muting the game.