Camera Size = y / (2 * s)
Where:
y = Screen Height (px)
s = Desired Height of Photoshop Square (px)
Many game devs will prefer to work with a set size in Photoshop and then adjust their camera setup in Unity accordingly. Depending on the resolution and the target Photoshop size this can require some complicated trial and error. However an untraceable contributor in the comments section of Rocket 5’s wonderful tutorial series on 2D in Unity , provided a formula thus avoiding the trial and error.
Camera Size = x / ((( x / y ) * 2 ) * s )
Where:
x = Screen Width (px)
y = Screen Height (px)
s = Desired Height of Photoshop Square (px)
It’s a formula that works perfectly and I have setup a calculator to make the calculation process even easier via my Pixel Perfect Camera Size Calculator – Google Doc. Feel free to share, use and download as you wish.
本文介绍了一种简化游戏开发中相机尺寸调整的方法,通过特定公式计算Unity中相机尺寸,确保从Photoshop导出的资源在游戏中保持像素完美。文章还提供了一个便捷的计算器工具。


被折叠的 条评论
为什么被折叠?



