private void Build() { if (Input.GetButtonDown("Fire1")) { if (go_Preview.GetComponent <PreviewObject>().isBuildable()) { theQuickSlot.DecreaseSelectedItem(); // 슬롯 아이템 개수 -1 GameObject temp = Instantiate(currentKit.kitPrefab, previewPos, Quaternion.identity); temp.name = currentKit.itemName; Destroy(go_Preview); currentKit = null; isPreview = false; } } }
private void DropAnItem(Slot _selectedSlot) { switch (_selectedSlot.item.itemType) { case Item.ItemType.Used: if (_selectedSlot.item.itemName.Contains("고기")) { Instantiate(_selectedSlot.item.itemPrefab, hitInfo.transform.position + Vector3.up, Quaternion.identity); theQuickSlot.DecreaseSelectedItem(); } break; case Item.ItemType.Ingredient: break; } }