vefeurope.blogg.se

Unity for mac os
Unity for mac os





unity for mac os unity for mac os

Let me know if anyone knows another way to do it. There may be an even better solution using, but using PlayerPrefs is good enough, while the game is full-screen by default. Screen.currentResolution gives the current resolutions (the window size in window mode). The reason we need PlayerPrefs to save the width and height is that, Unity cannot obtain the monitor size in full-screen mode. When changing from window to full-screen mode: set the width to 1920 and height proportional to the saved width/height ratio.When changing from full-screen to window mode: set the width to 1920 and height proportional to monitor size ( Screen.currentResolution), save both width and height in PlayerPrefs.Game is built-in default full-screen mode.Solution for full-screen modeĪfter some search, I couldn’t find a very promising solution and decided to come up with my own one. This is actually the designed behaviour from Unity and Unity seems intend to keep the letterbox instead of stretching the resolution (I doubted if any developer prefers this). This is a very unwanted behaviour, we simply want the game to take all space when it goes into full-screen mode.

#Unity for mac os windows#

If the player set the window to be very narrow in Windows Mode, then entering Full-Screen mode will result a letter-box: The letterbox appears when switching to Full-Screen Mode, and squeezed all UI elements. This works pretty well in both full-screen mode and windows mode until the player changes the size of the windows manually… Another problem - Letterbox For example, in modern 16:9 monitors, it set resolution 1920×1080. This set the screen width to 1920, and the height to proportional to the player’s monitor size (Screen.currentResolution). Screen.SetResolution(manualScreenWidth, Mathf.RoundToInt(1f * manualScreenWidth * / ), Screen.fullScreen) The first thing we do is manually setting the resolution with a script on game start: Enabling Mac Retina Support in Resolution and Presentation settings, causes lag in builds. I didn’t bother the figure out the reason but going straight into the solution. This may be because either we enabled Mac Retina Support, or we make the build in a high-resolution iMac and the default resolution is saved with the game build. This high resolution runs even in fullscreen, dragging down the performance and frame-rate of the game. Spotting the ProblemĪfter fighting the issue for a while, we’ve found that if we switch from the default fullscreen mode to the window mode, the window is very large (almost 4 times as the monitor size). In addition, it runs alright in Editor in Macbook but not in a build, so the hardware influence should be able to be ignored. Although the hardware of the Macbook is not even as good as the Windows laptop, we doubted the performance would be much different. The game runs smoothly in low-end Windows laptops but laggy in a 2016 Macbook. Recently, we have a performance issue on our macOS build.







Unity for mac os