How to change the project's Splash Image in a build?
My Unity mobile app features art and characters that the users select and identify as. By default, the Image used in Project Settings > Player > Splash Image > Background Image is a picture of my favorite hero. However I've just added a dropdown in the settings that allows users to select their favorite hero. Each hero has an associated Image, so I'd like to replace that Splash Image background with the user's favorite hero.
.
In code, I tried this: https://docs.unity3d.com/ScriptReference/PlayerSettings.SplashScreen-background.html
.
However this has 2 problems. In editor, it simply removes the image and doesn't show the one I've tried to change to. Then when I try to make a build, I am unable to do so because PlayerSettings exists in the UnityEditor namespace, so it does not exist in the context when building.
.
What code can I use to change the project's Splash Image Background in a build, given that I already have a variable/reference to the new Sprite I want to use?