Exemplo n.º 1
0
    private void SetPlane()
    {
        int selected = planes.selectedIndex;

        //Debug.Log("selected index : " + selected);
        Planes.GoodsInfo goods = planes.goodsInfo[selected];
        playerScript.SetPlayerOptions(
            planes.planeSprite[selected], goods.itemSlot, goods.life, goods.shield);
        //Debug.Log("NAME : " + goods.name);
        itemSlotEa = goods.itemSlot;
        //Debug.Log("item slot ea : " + itemSlotEa);

        foreach (ItemSlotBox box in itemSlotBox)
        {
            Destroy(box.itemSlotBox);
        }
        itemSlotBox = new ItemSlotBox[itemSlotEa];
        for (int i = 0; i < itemSlotBox.Length; i++)
        {
            itemSlotBox[i] = new ItemSlotBox(buttonPrefab, itemSlot, i);
        }

        playerScript.SetPlayerOptions
            (planes.planeSprite[selected], goods.itemSlot, goods.life, goods.shield);
    }