UScriptStruct
继承关系
元方法
__index
-
用法:
UScriptStruct["StructMemberName"]或UScriptStruct.StructMemberName -
返回类型:
auto -
返回指定成员名称对应的值。
-
可以返回任意类型;对于较复杂类型,可对返回值调用
type()函数以确定其 Lua 类。 -
示例:
local scriptStruct = FindFirstOf('_UI_Items_C')
-- Either of the following can be used:
local item = scriptStruct['Item']
local item = scriptStruct.Item
__newindex
-
用法:
UScriptStruct["StructMemberName"] = NewValue或UScriptStruct.StructMemberName = NewValue -
尝试将指定成员名称的值设为
NewValue。 -
示例:
local scriptStruct = FindFirstOf('_UI_Items_C')
-- Either of the following can be used:
scriptStruct['Item'] = 5
scriptStruct.Item = 5
方法
GetBaseAddress()
- 返回类型:
integer - 返回值: 此 UScriptStruct 所属 UObject 在内存中的地址。
GetStructAddress()
- 返回类型:
integer - 返回值: 此 UScriptStruct 在内存中的地址。
GetPropertyAddress()
- 返回类型:
integer - 返回值: 对应
UProperty/FProperty在内存中的地址。
IsValid()
- 返回类型:
bool - 返回值: 此结构体是否有效。
IsMappedToObject()
- 返回类型:
bool - 返回值: 基础对象是否有效。
IsMappedToProperty()
- 返回类型:
bool - 返回值: 属性是否有效。
type()
- 返回类型:
string - 返回值:
"UScriptStruct"
原文:docs/lua-api/classes/uscriptstruct.md · 固定提交 560411f18512 · 来源与 MIT 许可