void OnDestroy() { _simpleEvents.Detach(Player.PLAYER_UPDATE_STATS, OnStatsUpdate); _simpleEvents.Detach(Player.PLAYER_GET_DAMAGE, OnGetDamage); _simpleEvents = null; InventoryPanel.QuickSlotsPanel.OnSlotClickAction -= OnQuickSlotClick; InventoryPanel.OnSlotClickAction -= OnInventorySlotClick; if (CurrencyManager.OnChangeCurrency != null) { CurrencyManager.OnChangeCurrency -= UpdateBalance; } }
void OnDestroy() { _simpleEvents.Detach(Player.PLAYER_UNDER_WATER, OnUnderWater); _simpleEvents.Detach(Inventory.INVENTORY_ADD_ITEM, OnAddItemToInventory); _simpleEvents = null; }