ย ย https://giseung.tistory.com/19
ย public void SetResolution()
ย ย {
ย ย ย ย int setWidth = 1920; // ์ฌ์ฉ์ ์ค์ ๋๋น
ย ย ย ย int setHeight = 1080; // ์ฌ์ฉ์ ์ค์ ๋์ด
ย ย ย ย int deviceWidth = Screen.width; // ๊ธฐ๊ธฐ ๋๋น ์ ์ฅ
ย ย ย ย int deviceHeight = Screen.height; // ๊ธฐ๊ธฐ ๋์ด ์ ์ฅ
ย ย ย ย Screen.SetResolution(setWidth, (int)(((float)deviceHeight / deviceWidth) * setWidth), true); // SetResolution ํจ์ ์ ๋๋ก ์ฌ์ฉํ๊ธฐ
ย ย ย ย if ((float)setWidth / setHeight < (float)deviceWidth / deviceHeight) // ๊ธฐ๊ธฐ์ ํด์๋ ๋น๊ฐ ๋ ํฐ ๊ฒฝ์ฐ
ย ย ย ย {
ย ย ย ย ย ย float newWidth = ((float)setWidth / setHeight) / ((float)deviceWidth / deviceHeight); // ์๋ก์ด ๋๋น
ย ย ย ย ย ย Camera.main.rect = new Rect((1f - newWidth) / 2f, 0f, newWidth, 1f); // ์๋ก์ด Rect ์ ์ฉ
ย ย ย ย }
ย ย ย ย else // ๊ฒ์์ ํด์๋ ๋น๊ฐ ๋ ํฐ ๊ฒฝ์ฐ
ย ย ย ย {
ย ย ย ย ย ย float newHeight = ((float)deviceWidth / deviceHeight) / ((float)setWidth / setHeight); // ์๋ก์ด ๋์ด
ย ย ย ย ย ย Camera.main.rect = new Rect(0f, (1f - newHeight) / 2f, 1f, newHeight); // ์๋ก์ด Rect ์ ์ฉ
ย ย ย ย }
ย ย }
====
์ด๋ ๊ฒ ํ๋๋ฐ ๋ชจ๋ฐ์ผ๋ก ๋น๋ํ๋ฉด ์ ์์๋๊ฐ ์งค๋ฆด๊น...
๋ชจ๋ฐ์ผ์ ๋๋ ์ํด๋ด์ ํ์ค์น ์์ง๋ง ํ๋ ์ด์ด ์ ํ ๊ด๋ จํด์ ๋ญ๊ฐ ์๋ชป๋๊ฑฐ ์๋๊น?
https://docs.unity3d.com/Manual/class-PlayerSettingsiOS.html
Resolution and presentation ์ชฝ ์ฝ์ด๋ด
https://keykat7.blogspot.com/2019/11/unity-resolution-setting-multiple-camera.html