Learn
Motor Sınıfı
ContentProvider
Oluşturulamaz
Hizmet
Çoğaltılmamış

*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.


Özet
Yöntemler
Preload(contentId: ContentId):()
Artık Kullanılmayan
PreloadAsync(contentIdList: {any},callbackFunction: function):()
RegisterEncryptedAsset(assetId: ContentId,encryptionKey: string):()
RegisterSessionEncryptedAsset(contentId: ContentId,sessionKey: string):()
UnregisterEncryptedAsset(assetId: ContentId):()
Olaylar
AssetFetchFailed(assetId: ContentId):RBXScriptSignal
Devralınan Üyeler
Kod Örnekleri
İçerik Sağlayıcı
local ContentProvider = game:GetService("ContentProvider")
local LOGO_ID = "rbxassetid://658743164"
local PAGE_TURN_ID = "rbxassetid://12222076"
local decal = Instance.new("Decal")
decal.ColorMapContent = Content.fromUri(LOGO_ID)
local sound = Instance.new("Sound")
sound.SoundId = PAGE_TURN_ID
local assets = { decal, sound }
ContentProvider:PreloadAsync(assets)
print("Tüm varlıklar yüklendi.")

API Referansı
Özellikler
BaseUrl
Salt Okunur
Çoğaltılmamış
Paralel oku
Capabilities: AssetManagement
ContentProvider.BaseUrl:string

RequestQueueSize
Salt Okunur
Çoğaltılmamış
Paralel oku
Capabilities: AssetManagement
ContentProvider.RequestQueueSize:number
Kod Örnekleri
İçerik Sağlayıcı Yükleme Çubuğu
local ContentProvider = game:GetService("ContentProvider")
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
local playerGui = localPlayer:WaitForChild("PlayerGui")
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = playerGui
-- temel bir yükleme çubuğu oluşturun
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0.5, 0, 0.1, 0)
frame.Position = UDim2.new(0.5, 0, 0.5, 0)
frame.AnchorPoint = Vector2.new(0.5, 0.5)
frame.Parent = screenGui
local bar = Instance.new("Frame")
bar.Size = UDim2.new(0, 0, 1, 0)
bar.Position = UDim2.new(0, 0, 0, 0)
bar.BackgroundColor3 = Color3.new(0, 0, 1)
bar.Parent = frame
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://9120386436"
local sound2 = Instance.new("Sound")
sound2.SoundId = "rbxassetid://9120385974"
local assets = {
sound,
sound2,
}
task.wait(3)
for i = 1, #assets do
local asset = assets[i]
ContentProvider:PreloadAsync({ asset }) -- 1 seferde, bekletir
local progress = i / #assets
bar.Size = UDim2.new(progress, 0, 1, 0)
end
print("yükleme tamamlandı")

Yöntemler
GetAssetFetchStatus
Capabilities: AssetManagement
ContentProvider:GetAssetFetchStatus(contentId:ContentId):Enum.AssetFetchStatus
Parametreler
contentId:ContentId
Kod Örnekleri
VarlıkGetirDurumunu İzleme
local ContentProvider = game:GetService("ContentProvider")
-- Yüklemek için bir örnek varlık
local ASSET_ID = "rbxassetid://9120386436"
local exampleAsset = Instance.new("Sound")
exampleAsset.SoundId = ASSET_ID
-- Varlığın mevcut AssetFetchStatus değerini çıktı olarak ver
local initialAssetFetchStatus = ContentProvider:GetAssetFetchStatus(ASSET_ID)
print("İlk AssetFetchStatus:", initialAssetFetchStatus)
-- Güncellemeleri dinle
local assetFetchStatusChangedSignal = ContentProvider:GetAssetFetchStatusChangedSignal(ASSET_ID)
local function onAssetFetchStatusChanged(newAssetFetchStatus: Enum.AssetFetchStatus)
print(`Yeni AssetFetchStatus: {newAssetFetchStatus}`)
end
assetFetchStatusChangedSignal:Connect(onAssetFetchStatusChanged)
-- Varlığı ön yüklemek için tetikle
local function onAssetRequestComplete(contentId: string, assetFetchStatus: Enum.AssetFetchStatus)
print(`Ön yükleme durumu {contentId}: {assetFetchStatus.Name}`)
end
ContentProvider:PreloadAsync({ exampleAsset }, onAssetRequestComplete)

GetAssetFetchStatusChangedSignal
Capabilities: AssetManagement
ContentProvider:GetAssetFetchStatusChangedSignal(contentId:ContentId):RBXScriptSignal
Parametreler
contentId:ContentId
Dönüşler
Kod Örnekleri
VarlıkGetirDurumunu İzleme
local ContentProvider = game:GetService("ContentProvider")
-- Yüklemek için bir örnek varlık
local ASSET_ID = "rbxassetid://9120386436"
local exampleAsset = Instance.new("Sound")
exampleAsset.SoundId = ASSET_ID
-- Varlığın mevcut AssetFetchStatus değerini çıktı olarak ver
local initialAssetFetchStatus = ContentProvider:GetAssetFetchStatus(ASSET_ID)
print("İlk AssetFetchStatus:", initialAssetFetchStatus)
-- Güncellemeleri dinle
local assetFetchStatusChangedSignal = ContentProvider:GetAssetFetchStatusChangedSignal(ASSET_ID)
local function onAssetFetchStatusChanged(newAssetFetchStatus: Enum.AssetFetchStatus)
print(`Yeni AssetFetchStatus: {newAssetFetchStatus}`)
end
assetFetchStatusChangedSignal:Connect(onAssetFetchStatusChanged)
-- Varlığı ön yüklemek için tetikle
local function onAssetRequestComplete(contentId: string, assetFetchStatus: Enum.AssetFetchStatus)
print(`Ön yükleme durumu {contentId}: {assetFetchStatus.Name}`)
end
ContentProvider:PreloadAsync({ exampleAsset }, onAssetRequestComplete)

ListEncryptedAssets
Capabilities: AssetManagement
ContentProvider:ListEncryptedAssets():{any}
Dönüşler

Preload
Artık Kullanılmayan

PreloadAsync
Bekletir
Capabilities: AssetManagement
ContentProvider:PreloadAsync(
contentIdList:{any}, callbackFunction:function
):()
Parametreler
contentIdList:{any}
callbackFunction:function
Varsayılan değer: "nil"
Dönüşler
()
Kod Örnekleri
Varlıkların Ön Yüklenmesi
local ContentProvider = game:GetService("ContentProvider")
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://9120386436"
local decal = Instance.new("Decal")
decal.ColorMapContent = Content.fromUri("rbxassetid://5447528495")
local assets = {
decal,
sound,
}
-- Her varlık çözümlendikçe buraya ulaşılacak
local callback = function(assetId, assetFetchStatus)
print("PreloadAsync() varlık kimliği çözüldü:", assetId)
print("PreloadAsync() son VarlıkFetchDurumu:", assetFetchStatus)
end
-- İçeriği ön yükle ve zamanı kaydet
local startTime = os.clock()
ContentProvider:PreloadAsync(assets, callback)
local deltaTime = os.clock() - startTime
print(("Ön yükleme tamamlandı, %.2f saniye sürdü"):format(deltaTime))

RegisterDefaultEncryptionKey
Capabilities: AssetManagement
ContentProvider:RegisterDefaultEncryptionKey(encryptionKey:string):()
Parametreler
encryptionKey:string
Dönüşler
()

RegisterDefaultSessionKey
Capabilities: AssetManagement
ContentProvider:RegisterDefaultSessionKey(sessionKey:string):()
Parametreler
sessionKey:string
Dönüşler
()

RegisterEncryptedAsset
Capabilities: AssetManagement
ContentProvider:RegisterEncryptedAsset(
assetId:ContentId, encryptionKey:string
):()
Parametreler
assetId:ContentId
encryptionKey:string
Dönüşler
()

RegisterSessionEncryptedAsset
Capabilities: AssetManagement
ContentProvider:RegisterSessionEncryptedAsset(
contentId:ContentId, sessionKey:string
):()
Parametreler
contentId:ContentId
sessionKey:string
Dönüşler
()

UnregisterDefaultEncryptionKey
Capabilities: AssetManagement
ContentProvider:UnregisterDefaultEncryptionKey():()
Dönüşler
()

UnregisterEncryptedAsset
Capabilities: AssetManagement
ContentProvider:UnregisterEncryptedAsset(assetId:ContentId):()
Parametreler
assetId:ContentId
Dönüşler
()

Olaylar
AssetFetchFailed
Capabilities: AssetManagement
ContentProvider.AssetFetchFailed(assetId:ContentId):RBXScriptSignal
Parametreler
assetId:ContentId

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.