[Roblox] 中文API 翻译 | Classes | Accessory
写在前面的话
roblox 更新了新的API文档,去除了原本中文版本开发文档,虽然全英文阅读API是每个程序员的基础技能,但是为了提高自己学习引擎效率(第一次接触编程学习),我抽时间翻译了全篇roblox API开发文档,并且使用中英文对照翻译的方式,加深学习,文档仅供学习参考,roblox官方经常更新文档API以及增添新功能,如有错误,还请指正
翻译文章顺序基于我学习API的顺序展开,可能会优先翻译核心的API,比如对象创建,事件处理等等,API顺序依照官网顺序排列
roblox脚本基于Lua 翻译时间 2024.9.2
Roblox Engine Classes
类表示 Roblox 引擎中的核心对象和服务。它们包含 属性、方法、事件和回调
Accessory 饰品
The Accessory Instance is the parent Instance of all accessories (regardless of their specific accessory type). It typically has a child Handle with a child Attachment and a WrapLayer in the case of Layered Clothing.
饰品对象Accessory是所有饰品的父对象(不管它们的特定饰品类型是什么,比如帽子,面部饰品等等)。在分层服装的情况下,它通常有一个子对象Handle(这个对象含有Attachment对象以及一个WrapLayer对象)
The Accessory class is the successor to the legacy Hat system. It’s cross-compatible with both the legacy R6 character system and the new R15 character system.
Accessory 类是遗留Hat系统的继承者。它与传统的R6角色系统和新的R15角色系统交叉兼容的。
If you insert an Attachment into the Accessory’s Handle with the same name as an Attachment in one of the character’s limbs, they connect and ignore properties inherited from the Accoutrement class. Otherwise, the Accessory functions identically to a Hat.
如果你在配件的 Handle 中插入一个与角色肢体上的附件同名的附件,它们会连接并忽略从装备类继承的属性。否则,配件的功能与帽子相同。
Note: If there are two matching Attachments, the resulting Weld is a child of the Accessory’s Handle. This differs from the legacy behavior of Hats where the Weld is always a child of the Head of the character.
注意:如果有两个匹配的附件,则产生的焊缝是附件句柄的子对象。这与帽子的遗留行为不同,在那里焊缝总是角色头部的子对象。
总结 Summary
Properties 属性
AccessoryType: Enum.AccessoryType ----- Read Parallel 读取并行
AccessoryType类型有例如:帽子,T恤,腰部饰品等等
指定附件的 AccessoryType。是 AccessoryType.Unknown,除非你装备了该配饰 通过玩家生成过程或 Humanoid:ApplyDescription()。如果 Marketplace 上提供,则您 可以设置 Enum.AccessoryType 对 Accessory 项(对于 例如,“Hat” 或 “Face”)。
从 Accoutrement (装备) 继承的属性
属性名称 | 数据类型 | 可读性 | 备注 |
---|---|---|---|
AttachmentForward | Vector3 | Hidden 隐藏1 Not Replicated不可复制2 Read Parallel 读取并行3 | 设置 Player 上对象的偏移位置 |
AttachmentPoint | CFrame | 读取并行 | 装备的准确 CFrame |
AttachmentPos | Vector3 | 隐藏 不可复制 读取并行 | 设置对象在 Player 上的位置 |
AttachmentRigh | Vector3 | 隐藏 不可复制 读取并行 | 设置 Player 上对象的偏移位置 |
AttachmentUp | Vector3 | 隐藏 不可复制 读取并行 | 设置 Player 上对象的偏移位置 |
Methods 方法
查看从 Instance 继承的所有内容
Events
查看从 Instance 继承的所有内容