MobileSimulator

Author: Bit Barrel Media

Credits: jspease

Description
This script undocks the Game window and sets it to a size which matches the physical size of the mobile device targeted. This way you can test for example if the size of text is not too small on HD devices.

Usage
-Place the GameWindowSize.cs script in YourProject/Assets/Editor.

-Place the StoredEditorData.cs in YourProject/Assets/Scripts.

-Set the variable called monitorInchX in GameWindowSize.cs to the physical horizontal size of the monitor you use to view the Editor.

-A menu item will appear in Window\Game Window Size\. Select the mobile target device and the Game window will undock and resize to match the physical size of the mobile.

-Add this line to the Start function of the script where you set the scale of your game world:

-When running in the Editor only, multiply the scale of your game world by this:

-Note that you need to set the Game window size via the menu first before you can access storedEditorData.scaleFactor

-If the monitor resolution is not large enough, the Game window will be clipped.

-mobilePPI must be set to the ppi (dpi) reported by Screen.dpi, not the actual ppi.

-If any changes are made to GameWindowSize.cs, the menu has to be selected again in order to update StoredEditorData.