🐛 fixed ObjectDisposedException from the Inventory when switching scenes.
This commit is contained in:
@@ -32,6 +32,11 @@ public partial class VesnaBehaviour2D : Node
|
||||
_inventoryManager.SlotIndexChanged += HandleInventorySelectedSlotIndexChanged;
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
_inventoryManager.SlotIndexChanged -= HandleInventorySelectedSlotIndexChanged;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when picking up an item.
|
||||
/// Makes sure that item animations are also updated when they are occupying a currently empty spot.
|
||||
|
||||
Reference in New Issue
Block a user