Skip to main content

ItemContainer.AddItems

Declaration#

public virtual void AddItems(List<GDTKItem> items, Action<AddItemResult> callback)

Parameters#

NameDescription
itemsId of the item to add
callbackNumber of the item to add

Description#

Add a list of items item to the container

Usage#

using NullSave.GDTK.Inventory;using System.Collections.Generic;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(ItemContainer target, List<GDTKItem> items)    {        target.AddItems(items, ItemAddedCallback);    }
    private void ItemAddedCallback(AddItemResult result)    {        // This method is invoked for each individual item/stack added    }
}

Declaration#

public virtual void AddItems(List<ReferenceInfo> references, Action onComplete, bool raiseEvents)

Parameters#

NameDescription
referencesList of ReferenceInfos to add
onCompleteRaise associated events
raiseEventsRaise system events

Description#

Add multiple items from a reference list

Usage#

using NullSave.GDTK.Inventory;using System.Collections.Generic;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(ItemContainer target, List<ReferenceInfo> other)    {        target.AddItems(other, AddComplete, true);    }
    private void AddComplete()    {        // This method raised after all items added    }
}