什么是Swift的UIScreen.mainScreen()。在Unity 2d中的界限?

时间:2016-03-27 14:00:45

标签: unity3d unity5

基本上,我来自Swift SpriteKit背景,其中UIScreen.mainScreen().bounds是一个CGRect,代表屏幕,可以通过各种方式进行操作,例如使用

获取屏幕中间部分
var screenCenter = CGPointMake(UIScreen.mainScreen().bounds.width/2, UIScreen.mainScreen().bounds.height/2)

我正在开发一款2D拼图游戏,因此我将相机设置为正交。我想操纵游戏场景中的视图。 什么是Unity中的UIScreen.mainScreen().bounds(C#Scripting)可以操作以类似方式获取各种职位?

1 个答案:

答案 0 :(得分:2)

可能是:

Screen.width;
Screen.height;

http://docs.unity3d.com/ScriptReference/Screen.html