Getting the Unity iOS Splash Screen

时间:2015-06-25 18:20:54

标签: ios unity3d

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 个答案:

答案 0 :(得分:0)

1。检查设备分辨率

您可以使用Screen.widthScreen.height检查设备分辨率:

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

2。对所有设备使用相同的图像

我不知道你的启动画面是如何设置的。但我在之前的项目中所做的是为所有设备使用相同的图像。基本上我只是使用了4:3(iPad(视网膜))版本并制作了一个脚本,可以根据它的宽度进行缩放,并在具有更宽屏幕的设备上切割顶部和底部区域。 根据您的GUI系统,您可以将图像锚定到屏幕的边缘。