Exemplo n.º 1
0
    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);
    }