배우기
엔진 클래스
ContentProvider
만들 수 없음
서비스
복제되지 않음

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.


요약
메서드
Preload(contentId: ContentId):()
사용되지 않음
PreloadAsync(contentIdList: {any},callbackFunction: function):()
RegisterEncryptedAsset(assetId: ContentId,encryptionKey: string):()
RegisterSessionEncryptedAsset(contentId: ContentId,sessionKey: string):()
UnregisterEncryptedAsset(assetId: ContentId):()
이벤트
AssetFetchFailed(assetId: ContentId):RBXScriptSignal
상속된 멤버
코드 샘플
콘텐츠 제공자
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("모든 자산이 로드되었습니다.")

API 참조
속성
BaseUrl
읽기 전용
복제되지 않음
병렬 읽기
기능: AssetManagement
ContentProvider.BaseUrl:string

RequestQueueSize
읽기 전용
복제되지 않음
병렬 읽기
기능: AssetManagement
ContentProvider.RequestQueueSize:number
코드 샘플
콘텐츠 제공자 로딩 바
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
-- 기본 로딩 바 생성
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개씩, 대기
local progress = i / #assets
bar.Size = UDim2.new(progress, 0, 1, 0)
end
print("로딩 완료")

메서드
GetAssetFetchStatus
기능: AssetManagement
ContentProvider:GetAssetFetchStatus(contentId:ContentId):Enum.AssetFetchStatus
매개 변수
contentId:ContentId
코드 샘플
자산 가져오기 상태 모니터링
local ContentProvider = game:GetService("ContentProvider")
-- 로드할 예제 자산
local ASSET_ID = "rbxassetid://9120386436"
local exampleAsset = Instance.new("Sound")
exampleAsset.SoundId = ASSET_ID
-- 자산의 현재 AssetFetchStatus 출력
local initialAssetFetchStatus = ContentProvider:GetAssetFetchStatus(ASSET_ID)
print("초기 AssetFetchStatus:", initialAssetFetchStatus)
-- 업데이트 듣기
local assetFetchStatusChangedSignal = ContentProvider:GetAssetFetchStatusChangedSignal(ASSET_ID)
local function onAssetFetchStatusChanged(newAssetFetchStatus: Enum.AssetFetchStatus)
print(`새 AssetFetchStatus: {newAssetFetchStatus}`)
end
assetFetchStatusChangedSignal:Connect(onAssetFetchStatusChanged)
-- 자산을 미리 로드하도록 트리거
local function onAssetRequestComplete(contentId: string, assetFetchStatus: Enum.AssetFetchStatus)
print(`미리 로드 상태 {contentId}: {assetFetchStatus.Name}`)
end
ContentProvider:PreloadAsync({ exampleAsset }, onAssetRequestComplete)

GetAssetFetchStatusChangedSignal
기능: AssetManagement
ContentProvider:GetAssetFetchStatusChangedSignal(contentId:ContentId):RBXScriptSignal
매개 변수
contentId:ContentId
코드 샘플
자산 가져오기 상태 모니터링
local ContentProvider = game:GetService("ContentProvider")
-- 로드할 예제 자산
local ASSET_ID = "rbxassetid://9120386436"
local exampleAsset = Instance.new("Sound")
exampleAsset.SoundId = ASSET_ID
-- 자산의 현재 AssetFetchStatus 출력
local initialAssetFetchStatus = ContentProvider:GetAssetFetchStatus(ASSET_ID)
print("초기 AssetFetchStatus:", initialAssetFetchStatus)
-- 업데이트 듣기
local assetFetchStatusChangedSignal = ContentProvider:GetAssetFetchStatusChangedSignal(ASSET_ID)
local function onAssetFetchStatusChanged(newAssetFetchStatus: Enum.AssetFetchStatus)
print(`새 AssetFetchStatus: {newAssetFetchStatus}`)
end
assetFetchStatusChangedSignal:Connect(onAssetFetchStatusChanged)
-- 자산을 미리 로드하도록 트리거
local function onAssetRequestComplete(contentId: string, assetFetchStatus: Enum.AssetFetchStatus)
print(`미리 로드 상태 {contentId}: {assetFetchStatus.Name}`)
end
ContentProvider:PreloadAsync({ exampleAsset }, onAssetRequestComplete)

ListEncryptedAssets
기능: AssetManagement
ContentProvider:ListEncryptedAssets():{any}
반환

Preload
사용되지 않음

PreloadAsync
생성
기능: AssetManagement
ContentProvider:PreloadAsync(
contentIdList:{any}, callbackFunction:function
):()
매개 변수
contentIdList:{any}
callbackFunction:function
기본값: "nil"
반환
()
코드 샘플
자산 미리 로드
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,
}
-- 각 자산이 해결될 때마다 실행됩니다
local callback = function(assetId, assetFetchStatus)
print("PreloadAsync()가 자산 ID를 해결했습니다:", assetId)
print("PreloadAsync()의 최종 AssetFetchStatus:", assetFetchStatus)
end
-- 콘텐츠를 미리 로드하고 시간을 측정합니다
local startTime = os.clock()
ContentProvider:PreloadAsync(assets, callback)
local deltaTime = os.clock() - startTime
print(("미리 로드 완료, 소요 시간 %.2f 초"):format(deltaTime))

RegisterDefaultEncryptionKey
기능: AssetManagement
ContentProvider:RegisterDefaultEncryptionKey(encryptionKey:string):()
매개 변수
encryptionKey:string
반환
()

RegisterDefaultSessionKey
기능: AssetManagement
ContentProvider:RegisterDefaultSessionKey(sessionKey:string):()
매개 변수
sessionKey:string
반환
()

RegisterEncryptedAsset
기능: AssetManagement
ContentProvider:RegisterEncryptedAsset(
assetId:ContentId, encryptionKey:string
):()
매개 변수
assetId:ContentId
encryptionKey:string
반환
()

RegisterSessionEncryptedAsset
기능: AssetManagement
ContentProvider:RegisterSessionEncryptedAsset(
contentId:ContentId, sessionKey:string
):()
매개 변수
contentId:ContentId
sessionKey:string
반환
()

UnregisterDefaultEncryptionKey
기능: AssetManagement
ContentProvider:UnregisterDefaultEncryptionKey():()
반환
()

UnregisterEncryptedAsset
기능: AssetManagement
ContentProvider:UnregisterEncryptedAsset(assetId:ContentId):()
매개 변수
assetId:ContentId
반환
()

이벤트
AssetFetchFailed
기능: AssetManagement
ContentProvider.AssetFetchFailed(assetId:ContentId):RBXScriptSignal
매개 변수
assetId:ContentId

©2026 Roblox Corporation. Roblox 및 Roblox 로고, 'Powering Imagination'은 미국 및 기타 국가 내 당사의 등록 및 미등록 상표입니다.