unity EditorGUI绘制模型显示
作者:
好怕怕 | 来源:发表于
2022-11-27 15:00 被阅读0次

image.png
using UnityEditor;
using UnityEngine;
/// <summary>
/// GUI绘制模型显示
/// </summary>
public class GameObjectEditorWindow : EditorWindow
{
GameObject gameObject;
Editor gameObjectEditor;
[MenuItem("Window/GameObject Editor")]
static void ShowWindow()
{
GetWindow<GameObjectEditorWindow>("GameObject Editor");
}
void OnGUI()
{
gameObject = (GameObject)EditorGUILayout.ObjectField(gameObject, typeof(GameObject), true);
if (gameObject != null)
{
if (gameObjectEditor == null)
gameObjectEditor = Editor.CreateEditor(gameObject);
gameObjectEditor.OnPreviewGUI(GUILayoutUtility.GetRect(500, 500), EditorStyles.whiteLabel);
}
}
}
本文标题:unity EditorGUI绘制模型显示
本文链接:https://www.haomeiwen.com/subject/qwxkfdtx.html
网友评论