当前位置:网站首页>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;
}
}
边栏推荐
猜你喜欢
随机推荐
frp: open source intranet penetration tool
使用pipreqs导出项目所需的requirements.txt(而非整个环境)
pyspark---encode the suuid interval (based on the number of exposures and clicks)
sqlserver2019安装失败
001-进程与线程
swiper分类菜单双层效果demo(整理)
编程踩坑合集
五、《图解HTTP》报文首部和HTTP缓存
并发之多把锁和活跃性
ArcEngine(一)加载矢量数据
Docker starts mysql
ArcEngine(四)MapControl_OnMouseDown的使用
ArcEngine (1) Loading vector data
Logic Pro X自带音色库列表
WordPress主题-B2美化通用子主题商业运营版
LeetCode 每日一题——622. 设计循环队列
集群
国内IT市场还有发展吗?有哪些创新好用的IT运维工具可以推荐?
分析型数据库性能测试总结
【Kaggle实战】泰坦尼克号生存人数预测(从零到提交到Kaggle再到模型的保存与恢复)









