当前位置: 首页 > news >正文

Unity-可分组折叠的Editor

Unity-可分组折叠的Editor

  • 🥗功能介绍
  • 🍭用法

请添加图片描述

🥗功能介绍

在序列化的字段上标记特性:[FoldoutGroup(“xxx”)],inspector上就会被分组折叠显示。
(没有被指定的字段自动放到Default组中)
传送门🌈

🍭用法

1.Editor文件夹中新建一个xxxEditor,继承FoldoutGroupEditor

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace ZYF
{[CustomEditor(typeof(FoldoutGroupDemo))]public class FoldoutGroupDemoEditor : FoldoutGroupEditor{}}

2.在组件xxx中对字段进行分组特性标记:[FoldoutGroup(“xxx”)]

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace ZYF
{public class FoldoutGroupDemo : MonoBehaviour{const string Group_String = "String";[SerializeField, FoldoutGroup(Group_String)]private string test_string;[FoldoutGroup(Group_String)]public string test_string2;}}

http://www.mrgr.cn/news/10258.html

相关文章:

  • wxpython Scintilla styledtextctrl滚动条拖到头文本内容还有很多的问题
  • 1058 选择题——PAT乙级
  • 前端学习Day35
  • 网络安全售前入门02——产品了解
  • ReTagList标签列表(API)
  • Solon2 接口开发:实战 Gateway 模式效果
  • K8S 1.31 新功能: 跨核分发CPU
  • 【图像处理】Retinex算法用于图像亮度增强
  • 【Deep-ML系列】Pegasos Kernel SVM Implementation(手写支持向量机)
  • Spring MVC (面试篇)
  • <数据集>水面垃圾识别数据集<目标检测>
  • 【运维高级内容--MySQL】
  • 【C#】【EXCEL】Bumblebee/Classes/ExFont.cs
  • Mysql系列—3.体系架构
  • java反序列化之CommonCollections1利⽤链的学习
  • 改造小蚁摄像头支持免费无限容量云储存(Samba挂载篇)
  • ES(索引数据库)导入MySQL全量(批量导入)和增量数据Canal增量数据同步利器
  • ctfshow WEB刷题
  • ~/.bashrc 应用
  • Linux 驱动开发与Linux应用开发你知道多少?