U3DXT access LaunchImage/Splash screen?

I’d like to access the Splash screen texture from a Unity script. In searching for an answer I found this thread:

So I want to do something like:
Texture2D splash = new UIImage(@“LaunchImage”).ToTexture2D();
(but that doesn’t work)

Is it possible to access the splash screen texture this way? Thanks.

I figured it out.

string splashScreenName = "Default-Portrait@2x.png";  //you'll need to change this per device
string dataPath = Application.dataPath.Substring (0, Application.dataPath.Length - 4); //Remove "Data" from the end of the path
string imagePath = dataPath + splashScreenName;
UIImage image = new UIImage(imagePath);
Texture2D splashTexture = image.ToTexture2D();

Hi DuFF14, thanks for sharing this. One thing to be careful about using UIImage.ToTexture2D() is that it creates a new Texture2D, and the caller is responsible for destroying it once done, by calling Texture2D.destroy(splashTexture).

Alternatively, you can use Texture2D.LoadImage() passing in the bytes you get from the file.