public void equip() { GameObject cubeF = GameObject.Find("HasEquipmentNode"); if (hero == null) { return; } HasEquipmentNode t = cubeF.GetComponent <HasEquipmentNode>(); if (cubeF == null) { return; } Equipment temp = t.equipment; equipment.AddEquipToHero(hero); t.set(equipment, equipment.EquipmentType); if (temp == null) { Debug.Log(index); Debug.Log(tempList.Count); Destroy(tempList[index]); tempList.Remove(tempList[index]); for (int i = index; i < tempList.Count; i++) { GameObject ob = tempList[i]; UnEquipmentNode m = ob.GetComponent <UnEquipmentNode>(); m.index = m.index - 1; m.transform.position = new Vector3(m.transform.position.x, m.transform.position.y + 150f, m.transform.position.z); } } /* else * { * Set(temp); * }*/ Set(temp); }
public void selectEquippedEuipment(Equipment p, EquipmentType type) { nodeUI1.ui.SetActive(true); nodeUI1.set(p, type); }