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