该技能用于管理 Unity 中的 GameObject 组件,可完成挂载与移除、跨对象复制、开关以及读写序列化字段。查询类接口 component_list、component_get_properties、component_get_serialized_properties 为只读半自动模式;写入类为全自动模式,其中 component_remove 与 component_remove_batch 在审批/自动模式下禁止执行,仅能在 Bypass 或命中 Allowlist 时运行。单个与批量技能成对提供,包括 component_add、component_set_property、component_set_serialized_property 及其 batch 版本;component_copy 与 component_copy_exact、component_set_enabled 无批量版本。目标可用 name、instanceId 或 path 指定,批量项不支持 entityId。componentType 必填,可用类名或命名空间.类名。属性命名分两套:C# 成员名与 SerializedProperty 路径,前者忽略大小写且可写私有字段。设置属性时值来源按 assetPath、referencePath/referenceName、value 顺序只取其一,未提供则写类型默认值。批量调用为全或全无,某项失败会回滚整个调用。常见错误包含 TARGET_NOT_FOUND、MISSING_PARAM、SEMANTIC_INVALID 与 SKILL_ERROR。具体签名与参数须查 schema,不存在的接口如 component_create、component_get、component_find 不应使用。
unity-component
通用与其它
更新于 10-15 17:25