当前位置:网站首页>Unity关于编辑器扩展自定义标签,方便扩展Inspector
Unity关于编辑器扩展自定义标签,方便扩展Inspector
2022-08-03 08:08:00 【charlsdm】
Unity关于编辑器扩展自定义标签,方便扩展Inspector,下边附上我写的代码的案例,方便大家学习,或者观看
public enum IngredientUnit {
Spoon, Cup, Bowl, Piece }
// Custom serializable class
[Serializable]
public class Ingredient
{
public string name;
public int amount = 1;
public IngredientUnit unit;
}
public class Recipe : MonoBehaviour
{
public Ingredient potionResult;
public Ingredient[] potionIngredients;
[Range(0f, 10f)]
public float myfloat = 0f;
[MyRangeAttribute(10.0f,100.0f)]
public float Otherfloat;
}
public class MyRangeAttribute : PropertyAttribute
{
public readonly float min;
public readonly float max;
public MyRangeAttribute(float min,float max)
{
this.min = min;
this.max = max;
}
}
边栏推荐
- mysql 8.0.12 安装配置方法并--设置修改密码
- 解决移动端有纵向滚动条但是不能滚动的问题
- 流行和声基础大笔记
- "Swordsman Offer" brush questions print from 1 to the largest n digits
- AI mid-stage sequence labeling task: three data set construction process records
- “唯一索引允许为空“ 的说法是不严谨的
- 如何让背景色在任何设备宽高都能填充整个屏幕
- tolower函数
- ArcEngine (2) loading the map document
- Qt5开发从入门到精通——第二篇(控件篇)
猜你喜欢
Docker starts mysql
品牌方发行NFT时,应如何考量实用性?
DSP-ADAU1452输出通道配置
Docker启动mysql
mysql5.7服务器The innodb_system data file 'ibdata1' must be writable导致无法启动服务器
【愚公系列】2022年07月 Go教学课程 026-结构体
JMeter接口自动化发包与示例
二进制日志过期时间设置expire_logs_days
Using pipreqs export requirements needed for the project. TXT (rather than the whole environment)
如何使用电子邮件营销在五个步骤中增加产品评论
随机推荐
ArcEngine(六)用tool工具实现拉框放大缩小和平移
Redis分布式锁
Karatsuba大数乘法的Verilog实现
mysql服务器上的mysql这个实例中表的介绍
Taro框架-微信小程序-内嵌h5页面
0day_Topsec上网行为管理RCE
线性表
内存模型之有序性
36氪详情页AES
netstat 及 ifconfig 是如何工作的。
tolower函数
The use of the database table structure document generation tool screw
Taro框架-微信小程序-调用微信支付
LeetCode 每日一题——622. 设计循环队列
Docker启动mysql
C# 一周入门高级编程之《C#-接口》Day Two
Charles packet capture tool learning record
Evaluate: A detailed introduction to the introduction of huggingface evaluation indicator module
进程的创建
【收获合辑】k-NN与检索任务的异同+jupyter转pdf