Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Serializable 序列化
# Serializable 序列化 Inherits from Attribute The Serializable attribute lets you embed a class with sub properties in the inspector. Serializable(序列化)属性让你植入一个类用替代内容在 Inspector(检视面板) You can use this to display variables in the inspector similar to how a [Vector3](../Vector3/Vector3.html) shows up in the inspector. The name and a triangle to expand its properties. To do this you need create a class that derives from System.Object and give it the Serializable attribute. In JavaScript the Serializable attribute is implicit and not necessary. 你可以用这个去显示变量在 inspector(检视面板)类似于将一个 Vector3(3 维向量)显示在 inspector(检视面板)。这个名字和一个三角来扩展他的内容。去做这个你需要创建一个起源于 System.Object 的类并且给他 Serializable 属性。在 JavaScript 这个 Serializable 属性是隐含的,不必要的。 ``` class Test extends System.Object { var p = 5; var c = Color.white; } var test = Test (); ``` ``` // C# Example [System.Serializable] class Test { public int p = 5; public Color c = Color.white; } ```
da
2022年5月14日 15:01
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码