0
votes

My app has splash screens of varying sizes for different iOS devices. They are registered in the Unity PlayerSettings for iOS under 'iPhone 3.5"/Retina', 'iPhone 5.5" Landscape/Retina', etc.

My first scene is a loading scene that should look exactly like the splash screen (more initialization is going on under the hood).

I want to grab the splash screen asset that was used and place it in my loading scene, but I'm not sure how to determine exactly which asset was used.

I suppose I could build a lookup table keyed on strings returned by SystemInfo.DeviceModel, but that seems fragile. I'd much rather use however Unity determines which splash screen to display, but I haven't been able to find how that happens.

1

1 Answers

0
votes

1. Check the device resolution

You could check for the device resolution using Screen.width and Screen.height:

  • iPhone 3.5": 480 x 320 / 960 x 640 (retina)
  • iPhone 4": 1136 x 640
  • iPhone 4.7": 1334 x 750
  • iPhone 5.5": 2208 x 1242
  • iPad: 1024x768 / 2048 x 1536 (retina)

2. Use the same image for all devices

I don't know how's your splash screen set up. But what I did on a previous project was to use the same image for all devices. Basically I just used the 4:3 (iPad (retina)) version and made a script that scaled it to fit it's width and just cut of the top and bottom area on devices with a wider screen. Depending on your GUI system you may just anchor the image to the edges of the screen.