We are trying to programatically generate and set the Unity SplashScreen for Android and iOS.
The code below works when called from Unity [MenuItem("VoodooSauce/TEST")]
but doesn't work when called from IPreprocessBuildWithReport-OnPreprocessBuild
or RegisterBuildPlayerHandler
...
PlayerSettings.SplashScreen.logos = new[] {PlayerSettings.SplashScreenLogo.Create(3f, splashScreenSprite)};
We dynamically generate the "splashScreenSprite" and can successfully save it as a PNG.
We can even reload this PNG file as a Sprite.
However, regardless of what we do, the SplashScreen.logos code does not work ...
Strangely, regardless of where we call our code, it always updates the other fields in PlayerSettings.SplashScreen such as BackgroundColor, etc.