Ghi chú phát hành
Học
Lớp công cụ
KeyframeSequenceProvider
Đã Lỗi Thời
Không Thể Tạo
Dịch Vụ
Không Sao Chép

*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.


Tóm Tắt
Phương Pháp
GetAnimations(userId: User):Instance
Đã Lỗi Thời
GetKeyframeSequence(assetId: ContentId):Instance
Đã Lỗi Thời
GetKeyframeSequenceById(assetId: number,useCache: boolean):Instance
Đã Lỗi Thời
RegisterActiveKeyframeSequence(keyframeSequence: Instance):ContentId
RegisterKeyframeSequence(keyframeSequence: Instance):ContentId
Thành viên kế thừa
Mẫu mã
Tạo hoạt ảnh tạm thời
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local function createPreviewAnimation(keyframeSequence)
local hashId = KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence)
local Animation = Instance.new("Animation")
Animation.AnimationId = hashId
return Animation
end
local keyframeSequence = Instance.new("KeyframeSequence")
local animation = createPreviewAnimation(keyframeSequence)
print(animation)

Tài Liệu Tham Khảo API
Phương Pháp
GetAnimations
Đã Lỗi Thời

GetAnimationsAsync
Sinh Lợi
Các khả năng: Animation
KeyframeSequenceProvider:GetAnimationsAsync(userId:User):Instance
Tham Số
userId:User
Lợi Nhuận
Mẫu mã
Trình cung cấp KeyframeSequenceProvider GetAnimationsAsync
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local USER_ID = 0 -- Chèn UserId của bạn vào đây
local function extractPages(pagesObject)
local array = {}
while true do
local thisPage = pagesObject:GetCurrentPage()
for _, v in pairs(thisPage) do
table.insert(array, v)
end
if pagesObject.IsFinished then
break
end
pagesObject:AdvanceToNextPageAsync()
end
return array
end
local inventoryPages = KeyframeSequenceProvider:GetAnimationsAsync(USER_ID)
local animationIds = extractPages(inventoryPages)
for _, id in pairs(animationIds) do
print(id)
end
print("tổng cộng: ", #animationIds)

GetKeyframeSequence
Đã Lỗi Thời

GetKeyframeSequenceAsync
Sinh Lợi
Các khả năng: Animation
KeyframeSequenceProvider:GetKeyframeSequenceAsync(assetId:ContentId):Instance
Tham Số
assetId:ContentId
Lợi Nhuận
Mẫu mã
Lấy KeyframeSequence của một animation
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local ANIMATION_ID = "rbxassetid://507771019"
-- Lấy keyframe sequence cho tài nguyên
local keyframeSequence
local success, err = pcall(function()
keyframeSequence = KeyframeSequenceProvider:GetKeyframeSequenceAsync(ANIMATION_ID)
end)
if success then
-- Duyệt qua từng keyframe và in giá trị thời gian của nó
local keyframeTable = keyframeSequence:GetKeyframes()
for key, value in keyframeTable do
print(`Thời gian của keyframe số {key} là: {value.Time}`)
end
else
print(`Lỗi khi lấy KeyframeSequence: {err}`)
end

GetKeyframeSequenceById
Đã Lỗi Thời

RegisterActiveKeyframeSequence
Các khả năng: Animation
KeyframeSequenceProvider:RegisterActiveKeyframeSequence(keyframeSequence:Instance):ContentId
Tham Số
keyframeSequence:Instance
Lợi Nhuận
ContentId
Mẫu mã
Tạo hoạt ảnh tạm thời
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local function createPreviewAnimation(keyframeSequence)
local hashId = KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence)
local Animation = Instance.new("Animation")
Animation.AnimationId = hashId
return Animation
end
local keyframeSequence = Instance.new("KeyframeSequence")
local animation = createPreviewAnimation(keyframeSequence)
print(animation)

RegisterKeyframeSequence
Các khả năng: Animation
KeyframeSequenceProvider:RegisterKeyframeSequence(keyframeSequence:Instance):ContentId
Tham Số
keyframeSequence:Instance
Lợi Nhuận
ContentId
Mẫu mã
KeyframeSequenceProvider:RegisterKeyframeSequence
local KeyframeSequenceProvider = game:GetService("KeyframeSequenceProvider")
local asset = KeyframeSequenceProvider:RegisterKeyframeSequence(workspace.KeyframeSequence)
local animation = Instance.new("Animation")
animation.Name = "KiểmTraHoạtĐộng"
animation.AnimationId = asset
animation.Parent = workspace

©2026 Roblox Corporation. Roblox, logo Roblox và Powering Imagination là các nhãn hiệu đã đăng ký và chưa đăng ký của chúng tôi tại Hoa Kỳ và các quốc gia khác.