Last active
August 21, 2017 11:51
-
-
Save arclee/8c25e8354892a751f2334e92f5d16b18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void GUIMatrixAutoScale(float fromScreenX, float fromScreenY) | |
| { | |
| Matrix4x4 _matrix = GUI.matrix; | |
| _matrix.m00 = (float)Screen.width / fromScreenX; | |
| _matrix.m11 = (float)Screen.height / fromScreenY; | |
| GUI.matrix = _matrix; | |
| } | |
| void OnGUI() | |
| { | |
| // 你在 Editor 裡的原本看起來畫面大小。 | |
| GUIMatrixAutoScale(800.0f, 600.0f); | |
| // GUI 程式寫在下面。 | |
| // GUI.XXXX | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment