1 SerializedObject 和 SerializedProperty 在 Unity 中,可以完全自定义某一个脚本在 Inspector 窗口的相关显示。 SerializedObject 和 SerializedProperty 主要用于在 Unity 编辑器中操作和修改序列化对象的属性,通常在自定义编辑器中使用,以创建更灵活、可定制的属性面板。 只需记住简单的规则: SerializedObject:代表脚本对象。 参考文档:https://docs.unity.cn/cn/2022.1/ScriptReference/SerializedObject.html。 SerializedProperty:代表脚本对象中的属性。 参考文档:https://docs.unity.cn/cn/2022.1/ScriptReference/SerializedProperty.html。 2 自定义显示步骤 单独为某一个脚本实现一个自定义脚本,并且脚本需要继承 Editor。 一般该脚本命名为:自定义脚本名 + Editor。 在该脚本前加上特性。...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with Iserialization
Contact Iserialization, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack