CustomPropertyInfo

CustomPropertyInfo

CustomPropertyInfo 表包含有关自定义属性的信息。

使用此表时必须自行提供数据。

结构

键 值类型 子类型 说明
Name string __index 元方法所使用的名称
Type table PropertyTypes
BelongsToClass string 此属性所属类的完整名称,不含类型
OffsetInternal integer 或 table OffsetInternalInfo 仅当 Type 为 table 时才可使用子类型
ArrayProperty table ArrayPropertyInfo 仅当 Type 为 PropertyTypes.ArrayProperty 时使用

简单示例

创建一个名为 MySimpleCustomProperty 的自定义属性,将其视为 IntProperty,并访问 Character 类任意实例中偏移 0xF40 处的数据。

local CustomPropertyInfo = {
    ["Name"] = "MySimpleCustomProperty",
    ["Type"] = PropertyTypes.IntProperty,
    ["BelongsToClass"] = "/Script/Engine.Character"
    ["OffsetInternal"] = 0xF40
}

高级示例

创建一个名为 MyAdvancedCustomProperty 的自定义属性,将其视为内部类型为 IntProperty 的 ArrayProperty,并访问 Character 类任意实例中偏移 0xF48 处的数据。

local CustomPropertyInfo = {
    ["Name"] = "MyAdvancedCustomProperty",
    ["Type"] = PropertyTypes.ArrayProperty,
    ["BelongsToClass"] = "/Script/Engine.Character"
    ["OffsetInternal"] = 0xF48,
    ["ArrayProperty"] = {
        ["Type"] = PropertyTypes.IntProperty
    }
}

原文:docs/lua-api/table-definitions/custompropertyinfo.md · 固定提交 560411f18512 · 来源与 MIT 许可