Compare commits
2 Commits
cc0459eb33
...
ddf744ade4
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ddf744ade4 | ||
![]() |
02c675ed3f |
@ -19,4 +19,5 @@ MonoBehaviour:
|
||||
- {fileID: 7665229218737596710, guid: 71b177c2a18314c588da30429451666a, type: 3}
|
||||
- {fileID: 622422277636247943, guid: d95124918e5a4a246abb0d378b14d3fa, type: 3}
|
||||
- {fileID: 5136368050551183548, guid: 0aa6654feb91ef040b8b99d4f64688fc, type: 3}
|
||||
- {fileID: 5539371897028506726, guid: 21cff8c1505cd8041a474795e35e0192, type: 3}
|
||||
- {fileID: 8500549904376788358, guid: d81cf4649bf54485a8b0da7a235f3817, type: 3}
|
||||
|
@ -4,7 +4,8 @@ namespace DDD
|
||||
{
|
||||
public static class GameEvents
|
||||
{
|
||||
public static InteractionEvent Interaction = new InteractionEvent();
|
||||
public static InventoryChangedEvent InventoryChangedEvent = new();
|
||||
public static InteractionEvent Interaction = new();
|
||||
}
|
||||
public static class RestaurantEvents
|
||||
{
|
||||
@ -21,8 +22,5 @@ public class InteractionEvent : IEvent
|
||||
public GameObject Target;
|
||||
}
|
||||
|
||||
public class InventoryChangedEvent : IEvent
|
||||
{
|
||||
|
||||
}
|
||||
public class InventoryChangedEvent : IEvent { }
|
||||
}
|
||||
|
8
Assets/_DDD/_Scripts/GameState.meta
Normal file
8
Assets/_DDD/_Scripts/GameState.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46b89f8970a04e14b97419aeb4acb6c4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -55,7 +55,8 @@ public bool AddItem(string id, int quantity = 1)
|
||||
_inventoryItemDatas[id] = new InventoryItemData(id, quantity);
|
||||
}
|
||||
|
||||
EventBus.Broadcast(new InventoryChangedEvent());
|
||||
InventoryChangedEvent evt = GameEvents.InventoryChangedEvent;
|
||||
EventBus.Broadcast(evt);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -81,7 +82,8 @@ public bool RemoveItem(string id, int quantity = 1)
|
||||
_inventoryItemDatas.Remove(id);
|
||||
}
|
||||
|
||||
EventBus.Broadcast(new InventoryChangedEvent());
|
||||
InventoryChangedEvent evt = GameEvents.InventoryChangedEvent;
|
||||
EventBus.Broadcast(evt);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user