diff --git a/Assets/Plugins/Mediabox/CHANGELOG.md b/Assets/Plugins/Mediabox/CHANGELOG.md index 8b62cb9..573885b 100644 --- a/Assets/Plugins/Mediabox/CHANGELOG.md +++ b/Assets/Plugins/Mediabox/CHANGELOG.md @@ -4,9 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Calendar Versioning](https://calver.org). -## [2026.0122.0] - 2026-01-22 +## [2026.122.1] - 2026-01-22 ### Added - Workaround for Turkish users (Android export) +- Added code to mitigate Android Flicker bug after pause on Mali chips ## [2023.1127.1] - 2023-11-27 ### Added diff --git a/Assets/Plugins/Mediabox/Samples~/GameManager.cs b/Assets/Plugins/Mediabox/Samples~/GameManager.cs index 4fa6f7e..9c09541 100644 --- a/Assets/Plugins/Mediabox/Samples~/GameManager.cs +++ b/Assets/Plugins/Mediabox/Samples~/GameManager.cs @@ -9,9 +9,37 @@ namespace Mediabox.Samples { /// Details to this class can be found in the base class. /// public class GameManager : GameManagerBase { + + protected override Task OnStartGame(string contentBundleFolderPath, GameDefinition definition, string saveGamePath) { Debug.Log($"[GameManager] Starting Game: {JsonUtility.ToJson(definition)} at contentBundleFolderPath {contentBundleFolderPath} with saveGamePath {saveGamePath}"); return Task.CompletedTask; } + + public UniversalRenderPipelineAsset pipelineAsset = null; + + #if UNITY_ANDROID + + // Android flicker bug resolution: + void OnApplicationPause(bool pauseStatus) { + if (pauseStatus) return; + if (Time.time == 0) return; + if (SystemInfo.graphicsDeviceType != GraphicsDeviceType.Vulkan)return; + // Optional additional restriction. So far we have only seen Adreno chips with the error, + // but a lot of posts about Mali chips having other flickering bugs, we have opted out of + // implementing this restriction in case they are also effected. + // if (!SystemInfo.graphicsDeviceName.ToLower().Contains("adreno")) return; + ReflectionCallReleaseTargets(); + } + + void ReflectionCallReleaseTargets() { + if (pipelineAsset == null) return; + ScriptableRenderer renderer = pipelineAsset.GetRenderer(-1); + if (renderer == null) return; + var methodInfo = typeof(ScriptableRenderer).GetMethod("ReleaseRenderTargets", BindingFlags.Instance | BindingFlags.NonPublic); + methodInfo?.Invoke(renderer, Array.Empty()); + } + #endif } + } \ No newline at end of file diff --git a/Assets/Plugins/Mediabox/package.json b/Assets/Plugins/Mediabox/package.json index 70b91ba..7684f15 100644 --- a/Assets/Plugins/Mediabox/package.json +++ b/Assets/Plugins/Mediabox/package.json @@ -1,6 +1,6 @@ { "name": "com.wonderz.wunderbox", - "version": "2026.0122.0", + "version": "2026.122.1", "displayName": "Wunderbox Unity SDK", "description": "This is the Unity SDK used for WonderZ GmbH's Wunderbox Content Distribution Solution", "unity": "2019.4",