编者注
由于需要多屏幕的需求,这里在UnityEditor端实现相对简单,则需要获取并控制UnityEditor的Game窗口以及相关信息内容
信息搜索
通过Google查询到如下连接:
Game window size from editor window in editor mode
获得核心代码如下:
public static Vector2 GetMainGameViewSize()
{
System.Type T = System.Type.GetType("UnityEditor.GameView,UnityEditor");
System.Reflection.MethodInfo GetSizeOfMainGameView = T.GetMethod("GetSizeOfMainGameView",System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
System.Objec