Unity编辑器运行时设置GameView分辨率

Unity编辑器运行时设置GameView分辨率_第1张图片

Assembly assembly = typeof(UnityEditor.EditorWindow).Assembly;
Type type = assembly.GetType("UnityEditor.GameView");
var gameView = UnityEditor.EditorWindow.GetWindow(type);
MethodInfo mi = type.GetMethod("SizeSelectionCallback");
Debug.Log(mi.ToString());
mi.Invoke(gameView, new object[2] { 3, null });

0是Free Asepect 3是Full HD (1920x1080)

Unity 2021.3.11f1c2

你可能感兴趣的:(Unity,unity,编辑器,游戏引擎)