您当前的位置: 首页 >  unity

unity工具人

暂无认证

  • 5浏览

    0关注

    205博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

Unity 自定义编辑器时让子类继承父类的Inspector显示效果

unity工具人 发布时间:2022-07-10 23:12:01 ,浏览量:5

官方文档里的 CustomEditor函数

namespace UnityEditor
{
    //
    // 摘要:
    //     Tells an Editor class which run-time type it's an editor for.
    public class CustomEditor : Attribute
    {
        //
        // 摘要:
        //     Defines which object type the custom editor class can edit.
        //
        // 参数:
        //   inspectedType:
        //     Type that this editor can edit.
        //
        //   editorForChildClasses:
        //     If true, child classes of inspectedType will also show this editor. Defaults
        //     to false.
        public CustomEditor(Type inspectedType);
        //
        // 摘要:
        //     Defines which object type the custom editor class can edit.
        //
        // 参数:
        //   inspectedType:
        //     Type that this editor can edit.
        //
        //   editorForChildClasses:
        //     If true, child classes of inspectedType will also show this editor. Defaults
        //     to false.
        public CustomEditor(Type inspectedType, bool editorForChildClasses);

        //
        // 摘要:
        //     If true, match this editor only if all non-fallback editors do not match. Defaults
        //     to false.
        public bool isFallback { get; set; }
    }
}

在这里插入图片描述 CustomEditor有两个,调用第二个函数时第二个值为true就可以啦

关注
打赏
1656671177
查看更多评论
立即登录/注册

微信扫码登录

0.0376s