Hes*_*pen 1 c# unity-game-engine
如何强制 Unity 编辑器在播放模式下显示游戏视图,而不是我的自定义编辑器窗口?我有以下代码:
void Update(){
if (EditorApplication.isPlaying)
{
FocusWindowIfItsOpen(Type.GetType("UnityEditor.GameView"));
}
}
Run Code Online (Sandbox Code Playgroud)
我读过上面的内容应该改变窗口的焦点。但是,我似乎找不到此游戏视图窗口的正确类型。甚至在文档中也没有
小智 6
为了将焦点转移到 GameView,这对我有帮助:
EditorApplication.ExecuteMenuItem("Window/General/Game");
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3392 次 |
| 最近记录: |