public bool RemoveItems(Item item, int count) { Pocket pocket = pockets.Find(x => x.Item.Name == item.Name); if (pocket == null) { // Nothing to remove return(false); } pocket.RemoveItems(1); if (pocket.Count <= 0) { pockets.Remove(pocket); } if (TotalWeight <= MaxWeight) { GetComponent <CharacterController2D>().CanJump = true; } return(true); }