이벤트 정적 호출 변경 및 폴더 이동
This commit is contained in:
parent
cc0459eb33
commit
02c675ed3f
@ -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 { }
|
||||
}
|
||||
|
@ -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