-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInventoryChannel.cs
43 lines (33 loc) · 1.14 KB
/
InventoryChannel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using UnityEngine;
[CreateAssetMenu(menuName = "ScriptableObjects/Inventory/InventoryChannel")]
public class InventoryChannel : ScriptableObject
{
public delegate void InventoryItemLootCallback(InventorySystem.InventoryItem item, uint quantity);
public InventoryItemLootCallback OnInventoryItemLoot;
public delegate void InventoryClearCallback();
public InventoryClearCallback OnInventoryClear;
public delegate void InventoryExportCallback();
public InventoryExportCallback OnInventoryExport;
public delegate void InventoryImportCallback();
public InventoryImportCallback OnInventoryImport;
public void RaiseLootItem(InventorySystem.InventoryItem item)
{
OnInventoryItemLoot?.Invoke(item, 1);
}
public void RaiseLootItem(InventorySystem.InventoryItem item, uint quantity)
{
OnInventoryItemLoot?.Invoke(item, quantity);
}
public void RaiseInventoryClear()
{
OnInventoryClear?.Invoke();
}
public void RaiseInventoryExport()
{
OnInventoryExport?.Invoke();
}
public void RaiseInventoryImport()
{
OnInventoryImport?.Invoke();
}
}