Multiline(int lines):多行文本框 TextArea(int minlines, int maxlines):多行文本框(滑动条) ContextMenu(string item):组件菜单 DisallowMultipleComponent:不能在一个对象上重复添加该脚本 AddComponentMenu(string menuItem):在Component菜单中添加
代码示例1: using UnityEditor; using UnityEngine.UIElements; using UnityEngine; class MyCustomSettings : ScriptableObject { public const string k_MyCustomSettingsPath = "Assets/Editor/MyCustomSettings.asset"; [SerializeField] private int m_Number; [SerializeField] private string m_SomeString; internal...
当使用此属性时,对于int、float、string类型的变量,在Inspector面板修改变量值时,只有按下Enter键 或 鼠标失去焦点后才会返回新数值 publicclassDelayedExample:MonoBehaviour { // Attribute used to make a float, int, or string variable in a script be delayed. // When this attribute is used, the float,...
The Attribute class associates predefined system information or user-defined custom information with a target element. A target element can be an assembly, class, constructor, delegate, enum, event, field, interface, method, portable executable file module, parameter, property, return value, struct, ...
使用自定义的attribute 自定义的attribute需要继承System.Attribute,然后我们可以使用c#的预定义特性去注明此attribute的应用范围。如果我们自定义的attribute名为UI,那么我们的自定义的attribute类名则应该为UIAttribute。 usingSystem; public enum UILayer { Default, ...
使用一个Camera作为参照,将UI平面放置在Camera前的一定距离,因为是参照Camera,如果萤幕大小、分辨率、Camera视锥改变时UI平面会自动调整大小。如果Scene中的物件(GameObject)比UI平面更靠近摄影机,就会遮挡到UI平面。 1.Render Camera:用于渲染的摄影机 2.Plane Distance:与Camera的距离 ...
ContextMenuItemAttribute 参数:name 菜单名、function 方法名 作用于变量上,给作用的变量在Inspector上添加右键菜单方法 [ContextMenuItem("ResetString", "ResetSampleString")]publicstringSampleString="";voidResetSampleString(){SampleString="WarlGSampleString";} ...
1、StartCoroutine(string methodName) 2、StartCoroutine(IEnumerator method) 终止协程的两种方式: 常用的yield return: 协程的执行原理 与属性一起使用 三、委托(Delegate) 四、特性 (Attribute) 五、事件(Event) 事件变量与公开委托变量的区别 初学笔记,有错误欢迎大佬指出 一、列表和字典 列表与字典的工作原理类...
/// 重命名属性/// 新名称publicRenameAttribute(stringname){Name=name;}/// 重命名属性/// 新名称/// 文本颜色 例如:"#FFFFFF" 或 "black"publicRenameAttribute(stringname,stringColor){Name=name;HtmlColor=OrColor;}publicRenameAttribute(stringname,ColorhtmlColor){Name=name;HtmlColor=htmlColor....
支持JsonIgnore 跳过序列化 Attribute 二、下载LitJson源码并熟悉结构 我们的改造是基于 LitJson源码的,所以首先要去获取 LitJson源码,从官方的Github上面直接选择一个稳定的版本拉取下来就可以,马三用的是2019年12月份的稳定版本。源码Clone到本地以后,目录是这个样子: ...