|
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); } }} |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
|