/// <summary> /// Add the item to the inventory. /// </summary> private void DoItemPickup() { if (!IsActive || m_ActiveItemPickup == null) { return; } m_ActiveItemPickup.PickUpItems(m_Inventory); m_ActiveCollider = null; m_ActiveItemPickup = null; // Toggle the equipped item again only if the inventory is not switching. The inventory may switch if a new primary item was picked up. if (m_Unequipped && !m_IsSwitchingItems.Invoke()) { EventHandler.ExecuteEvent(m_GameObject, "OnAbilityToggleEquippedItem"); } // The ability is done as soon as the item has been picked up. StopAbility(); }