//******************************************************************* public void RemoveItemFromInventory(Item pItem, bool taken = false ) { Debug.Log("Removing " + pItem.mItemName ); //pItem.DrawInventoryIcon = false; if (mEquippedItem == pItem) { mEquippedItem = null; // if we have an item in our off hand equipt that if (mUnEquippedItem != null) { mEquippedItem = mUnEquippedItem; mUnEquippedItem = null; } } if (mUnEquippedItem == pItem) { mUnEquippedItem = null; } for(int i =0; i < mInventory.Length; i++) { Item item = mInventory[i]; if(item == null)continue; if(item.mItemName == pItem.mItemName) { mInventory[i] = null; break; } } if(!taken) { SoundManager.Play2DSound(pItem.mPlacementEffect); } else if(pItem.mPlacementAudio != String.Empty) { SoundManager.PlayMusic(pItem.GetAudioDirectory() + pItem.mPlacementAudio); } else { Debug.Log("Cannot play item placement audio!"); } }