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

在这里插入图片描述

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

猜你喜欢

转载自blog.csdn.net/AWNUXCVBN/article/details/132755935