Pages

Pages : Instance

Overview

Pages ๊ฐ์ฒด๋Š” ๋Œ€๋Ÿ‰์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์—ฌ๋Ÿฌ ํŽ˜์ด์ง€๋กœ ๋‚˜๋ˆ„์–ด ์ œ๊ณตํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

๊ฐ ํŽ˜์ด์ง€๋Š” ํ‚ค-๊ฐ’ ์Œ์ด ์ •๋ ฌ๋œ ๋ชฉ๋ก ํ˜•ํƒœ๋กœ ๊ตฌ์„ฑ๋ฉ๋‹ˆ๋‹ค.

Properties

IsFinished

bool

๋งˆ์ง€๋ง‰ ํŽ˜์ด์ง€์ธ์ง€ ์—ฌ๋ถ€๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

์ด๋ฅผ ํ†ตํ•ด ํŽ˜์ด์ง€๋ฅผ ์ˆœํšŒํ•  ๋•Œ, ๋‹ค์Œ ํŽ˜์ด์ง€ ์š”์ฒญ์ด ๊ฐ€๋Šฅํ•œ์ง€ ์—ฌ๋ถ€๋ฅผ ํŒ๋‹จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Code Samples

local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end) 
    
    if success then
        local worldProducts = errorOrWorldProducts
			
        while true do
            local currentPage = worldProducts:GetCurrentPage()	
		    
            -- ๋งˆ์ง€๋ง‰ ํŽ˜์ด์ง€์ด๋ฉด ๋ฃจํ”„ ํƒˆ์ถœ 
            if worldProducts.IsFinished or currentPage == nil then         	
                break
            end
        end
    end
end

Methods

GetCurrentPage

ํ˜„์žฌ ํŽ˜์ด์ง€์— ํฌํ•จ๋œ ๋ชจ๋“  ํ•ญ๋ชฉ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ˜ํ™˜๋œ ํ•ญ๋ชฉ๋“ค์˜ ํ‚ค ๊ตฌ์กฐ๋Š” ํ•ด๋‹น Pages ๊ฐ์ฒด๊ฐ€ ์–ด๋–ค ๋ฐ์ดํ„ฐ์—์„œ ์ƒ์„ฑ๋˜์—ˆ๋Š”์ง€์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์ง‘๋‹ˆ๋‹ค.

Parameters

Return

Array

ํ˜„์žฌ ํŽ˜์ด์ง€์— ๊ตฌ์„ฑ๋œ ์ •๋ณด์ž…๋‹ˆ๋‹ค.

Code Samples

local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end) 
    
    if success then
        local worldProducts = errorOrWorldProducts
        
        while true do
            local currentPage = worldProducts:GetCurrentPage()
        
            if currentPage ~= nil then
                for _, productInfo in pairs(currentPage) do	
                    print("World Product Name: " .. tostring(productInfo.Name))  
                end	
            end
        end
    end
end

AdvanceToNextPageAsync

Pages ๊ฐ์ฒด๋ฅผ ์ˆœํšŒํ•˜๋ฉด์„œ ๋‹ค์Œ ํŽ˜์ด์ง€๋กœ ์ด๋™ํ•ฉ๋‹ˆ๋‹ค.

๋‹จ, ํŽ˜์ด์ง€ ์ „ํ™˜์€ ๋‚จ์€ ํŽ˜์ด์ง€๊ฐ€ ์žˆ์„ ๋•Œ๋งŒ ์ฒ˜๋ฆฌ๋ฉ๋‹ˆ๋‹ค.

Parameters

Return

void

Code Samples

local MarketplaceService = game:GetService("MarketplaceService")

local function Request_GetWorldProductsAsync()
    local success, errorOrWorldProducts = pcall(function()
        return MarketplaceService:GetWorldProductsAsync()
    end) 
    
    if success then
        local worldProducts = errorOrWorldProducts
			
        while true do
            local currentPage = worldProducts:GetCurrentPage()	
		    
            -- ๋งˆ์ง€๋ง‰ ํŽ˜์ด์ง€์ด๋ฉด ๋ฃจํ”„ ํƒˆ์ถœ 
            if worldProducts.IsFinished or currentPage == nil then         	
                break
            else
                worldProducts:AdvanceToNextPageAsync()
            end
        end
    end
end

Events

Last updated