API
Interface
public interface IItemPlugin
{
// Item usage
void UseItem(GameObject user, ItemEntry item, ItemContext context);
void OnItemObtained(ItemContext context);
void OnItemDestroyed(ItemContext context);
void OnItemDropped(ItemContext context);
bool CanUseItem(GameObject user, ItemEntry item, ItemContext context);
// Type registration
void RegisterItemType(Type itemType, ItemTypeInfo info);
IReadOnlyDictionary<string, ItemTypeInfo> GetRegisteredItemTypes();
ItemTypeBase CreateItemTypeInstance(string typeId);
ItemInstance CreateItemInstance(ItemEntry entry, int quantity = 1);
// Inventory management
InventoryInstance GetInventory(string inventoryId);
InventoryInstance GetEntityInventory(string entityId, string inventoryId);
InventoryInstance CreateInventory(InventoryEntry entry,
string instanceId = null);
InventoryInstance CreateTemporaryInventory(InventoryEntry entry,
TimeSpan? duration = null);
bool DestroyInventory(string inventoryId);
IReadOnlyList<InventoryInstance> GetAllInventories();
InventoryOperationBuilder BeginOperation();
// Inventory events
event Action<InventoryInstance> OnInventoryCreated;
event Action<string> OnInventoryDestroyed;
event Action<InventoryContext> OnItemAdded;
event Action<InventoryContext> OnItemRemoved;
event Action<InventoryContext> OnItemMoved;
// Equipment definitions
List<EquipmentSlotEntry> GetAllEquipmentSlotDefinitions();
List<CharacterSheetEntry> GetAllCharacterSheetDefinitions();
List<BodyPartEntry> GetAllBodyPartDefinitions();
List<BodyMeshTypeEntry> GetAllBodyMeshTypeDefinitions();
List<BodyMeshConfigurationEntry> GetAllBodyMeshConfigurationDefinitions();
// Equipment operations
bool CanEquipItemToSlot(ItemEntry item, EquipmentSlotEntry slot);
EquipmentSlotEntry GetEquipmentSlotForItem(ItemEntry item);
bool IsItemEquippable(ItemEntry item);
EquipmentSlot CreateEquipmentSlot(EquipmentSlotEntry entry);
IVisualEquipmentData GetItemVisualEquipmentData(ItemEntry item);
void EquipVisualItem(GameObject character, ItemEntry item,
EquipmentSlot slot = null, bool isInCombat = false);
void UnequipVisualItem(GameObject character, ItemEntry item,
EquipmentSlot slot = null);
}Key Data Classes
ItemEntry
Field
Type
Description
ItemInstance
Field
Type
Description
InventoryEntry
Field
Type
Description
InventoryInstance
EquipmentSlotEntry
LootTableEntry
Events
Event
Description
Commands
Command
Description
Components
Component
Description
Save Data
Usage
Last updated
Was this helpful?
