void Start() { instance = this; activateItem = new Item(); //gameObjectSlot = new GameObject[gameObject.transform.GetChildCount()]; inventory = GameObject.FindGameObjectWithTag("Player").GetComponent <Inventory>(); cratfSlot = new Slot[3]; previousSlot = new string[3]; for (int i = 0; i < 3; ++i) { //gameObjectSlot[i] = gameObject.transform.GetChild(i).GetComponent<GameObject>(); if (gameObjectSlot[i].GetComponent <Slot>() != null) { cratfSlot[i] = gameObjectSlot[i].GetComponent <Slot>(); cratfSlot[i].type = (int)Slot.SlotType.Parts; cratfSlot[i].action = (int)Slot.ActionType.Craft; } else { Debug.Log("Craft란에 Slot이 필요합니다."); return; } } CloseCraftSlot(); }
public override void ProcessClick(Vector2 pos) { base.ProcessClick(pos); List <CraftingSlot> activeSlots = CraftSlots.FindAll(x => x.Active); foreach (CraftingSlot slot in activeSlots) { if (slot.MyRect.Contains(pos)) { _ChemistryManager.ProcessRecipe(slot.MyRecipe); break; } } }