Exemplo n.º 1
0
        public override GameObject DropItem(InventoryItemBase item, Vector3 position, Quaternion rotation)
        {
            if (item.isDroppable == false ||
                (item.itemCollection != null && item.itemCollection.canDropFromCollection == false))
            {
                return(null);
            }

            var dropObj = CreateDropObject(item);
            var dropPos = CalculateDropPosition(item, position, rotation);

            dropObj.transform.SetParent(null); // Drop item into the world
            dropObj.transform.position = dropPos;
            dropObj.layer = InventorySettingsManager.instance.settings.itemWorldLayer;
            dropObj.SetActive(true);

            item.NotifyItemDropped(dropObj);

            return(dropObj);
        }