找回密码
 立即注册
查看: 176|回复: 0

unity EditorGUI绘制模型显示

[复制链接]
发表于 2022-11-29 13:56 | 显示全部楼层 |阅读模式

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开发者联盟 ( 粤ICP备20003399号 )

GMT+8, 2024-6-27 06:25 , Processed in 0.099158 second(s), 26 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表