别名
getactorfromstate
参数
thread
必填
要检查其 thread data 中 associated Actor weak reference 的 Luau thread。
返回值
Instance | nil
从 thread 的 the associated Actor weak reference 解析出的 Actor Instance,或在没有 valid actor reference 时返回 nil。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
返回与 Luau thread 关联的 Actor Instance。第一个 argument 必须是 thread。function 会读取该 thread 的 thread data,要求存在 Actor reference 且 container count 为 positive,然后读取 the associated Actor。如果 actor weak reference 有效,就作为 Instance push;否则 function 返回 nil。
getactorfromthread(thread: thread): Instance | nil
getactorfromstatefor _, thread in ipairs(getactorthreads()) do
local actor = getactorfromthread(thread)
print(actor)
end