SInventoryItem
在此类中StoreCustomData
| 函数 | StoreCustomData | Updates the inventory items custom data, and requests a synchronisation with the inventory server. |
| 函数 | Use | Player will 'Use' this item. (White-label only) |
| 函数 | Delete | Player will 'Delete' this item. (White-label only) |
| 属性 | MasterID | The master ID for this item - also known as the Curator ID or Item ID, this is the ID for the master item from which this copy exists. |
| 属性 | PlayerItemID | The instance ID for this item - this is guaranteed to be unique per inventory item |
| 属性 | Name | Returns the name of the inventory item |
| 属性 | Description | Returns the registered description of the inventory item in the users locale |
| 属性 | Brand | Returns brand information about the item |
| 属性 | CustomData | Returns any custom data associated with this item, typically used for 'game' items |
函数
StoreCustomData
Updates the inventory items custom data, and requests a synchronisation with the inventory server. It may not update on the server immediately, but all local calls will reflect the new data. Note: this request can be rate limited and should only be called from a user initiated action (such as clicking a button). Updates to custom data must not be initiated on a timer or regular automatic event. Access to this function can be blacklisted to specific creators if abused.
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| data | string | – |
返回值
bool
示例
Items = Space.Inventory.Items
Items[1].StoreCustomData('data1data2data3')
Use
Player will 'Use' this item. (White-label only)
返回值
void
示例
Items = Space.Inventory.Items
Items[1].Use()
Delete
Player will 'Delete' this item. (White-label only)
返回值
void
示例
Items = Space.Inventory.Items
Items[1].Delete()
属性
MasterID只读
The master ID for this item - also known as the Curator ID or Item ID, this is the ID for the master item from which this copy exists.
示例
Items = Space.Inventory.Items
iMasterID = Items[1].MasterID
PlayerItemID只读
The instance ID for this item - this is guaranteed to be unique per inventory item
示例
Items = Space.Inventory.Items
iPlayerItemID= Items[1].PlayerItemID
Name只读
Returns the name of the inventory item
示例
Items = Space.Inventory.Items
iName= Items[1].Name
Description只读
Returns the registered description of the inventory item in the users locale
示例
Items = Space.Inventory.Items
iDescription=Items[1].Description
Brand只读
Returns brand information about the item
示例
Items = Space.Inventory.Items
iBrand = Items[1].Brand
CustomData只读
Returns any custom data associated with this item, typically used for 'game' items
示例
Items = Space.Inventory.Items
iCustomData = Items[1].CustomData



