Inventory.ReplaceItem
#
Declarationpublic void ReplaceItem(string instanceId, string itemId)
#
ParametersName | Description |
---|---|
instanceId | Instance Id of the item to replace |
itemId | Id of the item to replace with |
#
DescriptionReplace an existing item with a new one
#
UsageExample
using NullSave.GDTK.Inventory;using UnityEngine;
public class CodeSample : MonoBehaviour{
public void ExampleMethod(Inventory target, GDTKItem oldItem, GDTKItem newItem) { // Removes an item from inventory and replaces it with a new one // If item was equipped, the replacement will be as well target.ReplaceItem(oldItem.instanceId, newItem.info.id); }
}