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

csharp 复制代码
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

相关推荐
wgslucky11 小时前
Godot GDScript初学者遇到的问题记录
游戏引擎·godot
点心的游戏开发世界13 小时前
GDScript 入门笔记(五):函数
笔记·游戏引擎·godot
谢斯16 小时前
[unity]如何在unity中添加newtonsoft-json
unity·json·游戏引擎
天人合一peng17 小时前
Unity标记固定颜色及投影标记
unity
云雨巫山21 小时前
Unity 游戏开发性能优化全景手册
unity·智能手机·性能优化·游戏引擎
maybeyaluokenai21 小时前
unity build in渲染管线概述
unity·图形渲染
学习星球21 小时前
AI 原生游戏开发:Godot 4 + AI Agent 全栈指南(Ziva 3 / Godot MCP 深度实战)
人工智能·游戏引擎·godot
山峰哥21 小时前
造价算量系统SQL优化,慢查询从9秒压到35毫秒‌
大数据·数据库·sql·编辑器·深度优先
云雨巫山21 小时前
Unity 性能优化 · 图解全景手册
unity·性能优化·游戏引擎
-To be number.wan1 天前
编译原理第三章:编译器是怎么“认字“的?——词法分析全解析
学习·编辑器