gamecircle.Whispersync.SetLowNumberListLength

类型 函数
gamecircle.*
返回值
修订版 2024.3703 版
关键字 Low、List、SyncableNumberList、Length、Whispersync

概述

设置 LowNumber 列表的最大长度。此数字由 Amazon GameCircle SDK 限制为最高 1,000。默认长度为 5。

语法

gamecircle.Whispersync.SetLowNumberListLength(key, value)
gamecircle.Whispersync.SetLowNumberListLength(key, value)
key (必需)

字符串. 用于访问特定最小数字的键。

value (必需)

数字. 要分配给最小数字的值。

示例

local lowListKey = "myFirstLowNumberList" 
local gamecircle = require("plugin.gamecircle")  
gamecircle.Init(false, false, true)  
gamecircle.Whispersync.SetLowNumberListLength(lowListKey, 4)  
gamecircle.Whispersync.AddToLowNumberList(lowListKey, 10, "INT")  
gamecircle.Whispersync.AddToLowNumberList(lowListKey, 1000, "INT")  
gamecircle.Whispersync.AddToLowNumberList(lowListKey, 1, "INT")  
gamecircle.Whispersync.AddToLowNumberList(lowListKey, 10000, "INT")   
gamecircle.Whispersync.AddToLowNumberList(lowListKey, 100, "INT")  
print("Here is the list of numbers as they are stored in the low number list. They should be in the order from lowest to highest.")  
local lowList = gamecircle.Whispersync.GetLowNumberList(lowListKey)  
for i,entry in ipairs(lowList) do  
    print("-" entry.value)  
end  
local keys = gamecircle.Whispersync.GetLowNumberListKeys()  
for i,key in ipairs(keys) do  
    print("-" .. key)  
end