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.
标签:Photoshop,Camera,px,Height,camera,Screen,unitu,size From: https://blog.51cto.com/u_16166892/6528222