| 12345678910111213141516171819202122232425262728 |
- using UnityEngine;
- #if UNITY_EDITOR
- using UnityEditor;
- #endif
- namespace AdaptUI
- {
- public static class GameViewSizeHelper
- {
- public static Vector2 GetGameViewSize()
- {
- #if UNITY_EDITOR
- return GetGameViewSize_Editor();
- #else
- return new Vector2(Screen.width, Screen.height);
- #endif
- }
- #if UNITY_EDITOR
- public static Vector2 GetGameViewSize_Editor()
- {
- return Handles.GetMainGameViewSize();
- }
- #endif
- }
- }
|