Exemple #1
0
    public void DonateItem(V_InventoryItem item)
    {
        if (item == null)
        {
            return;
        }

        UIController.SelectFromListModal("Do you want to donate " + item.name,
                                         () => {},
                                         () => { UIController.CloseSelectModal(); },
                                         (playerName) => { /*find a player with playerName*/ });
    }
Exemple #2
0
 private void ShowUpgrades(V_InventoryItem item)
 {
     if (item.itemClass != ItemClass.WEAPON)
     {
         return;
     }
     // weaponUpgradePanel.SetActive(true);
     // foreach (V_UpgardeObject upgrade in item.itemPrfb.GetComponent<V_Weapon>().upgrades)
     // {
     //  GameObject tmpObj = UIController.emptyObjectWithImage;
     //  // tmpObj.AddComponent<Image>();
     //  tmpObj.GetComponent<Image>().sprite = upgrade.icon;
     //  tmpObj.transform.SetParent(weaponUpgradePanel.transform ,false);
     // }
     // throw new NotImplementedException();
 }
Exemple #3
0
    protected void CompareItems(V_InventoryItem item1, V_InventoryItem item2 = null)
    {
        // if so, there has been an error
        if (item1 == null)
        {
            print("V_Inventory_UI: CompareItems(): Cannot compare Items");
            return;
        }
        if (item2 != null)
        {
            // prevent comparing 2 items from the different types
            if (item1.itemType != item2.itemType)
            {
                return;
            }
        }
        switch (item1.itemType)
        {
        case ItemTypes.W_PISTOL:
            CompareWeapon(item1, item2);
            break;

        case ItemTypes.W_ASSAULT:
            CompareWeapon(item1, item2);
            break;

        case ItemTypes.G_UPPERBODY:
            CompareGear(item1, item2);

            break;

        case ItemTypes.G_LOWERBODY:
            CompareGear(item1, item2);
            break;

        case ItemTypes.G_HEAD:
            CompareGear(item1, item2);
            break;

        default:
            UIController.ThrowError("V_Inventory_UI: CompareItems(): error while loading items' types!", () =>
            {
                UIController.CloseError();
            });
            break;
        }
    }
Exemple #4
0
    void CompareWeapon(V_InventoryItem item1, V_InventoryItem item2)
    {
        tmpWeapon1 = item1.itemPrfb.GetComponent <V_Weapon>();

        if (tmpWeapon1 == null)
        {
            UIController.ThrowError("V_Inventory_UI: CompareWeapon(): Cannot Find a inventoryItem reference", UIController.CloseError);
            return;
        }
        UIController.Enable_DisableUI(weaponComp, gearComp, characterComp);
        // if we have just the first Item, we wanna show its detail, but not compare it to anaother item
        if (item2 == null)
        {
            // sliders related to the first selected Item
            StartCoroutine(UIController.FillSlider(weaponComparer.accuracy_firstItem, tmpWeapon1.accuracy / 100f));
            StartCoroutine(UIController.FillSlider(weaponComparer.clipSize_firstItem, tmpWeapon1.clipSize / 100f));
            StartCoroutine(UIController.FillSlider(weaponComparer.damage_firstItem, tmpWeapon1.damage / 100f));
            StartCoroutine(UIController.FillSlider(weaponComparer.fireRate_firstItem, tmpWeapon1.fireRate / 100f));
            StartCoroutine(UIController.FillSlider(weaponComparer.weight_firstItem, tmpWeapon1.weight / 100f));

            // second Item sliders
            weaponComparer.accuracy_secondItem.gameObject.SetActive(false);
            weaponComparer.clipSize_secondItem.gameObject.SetActive(false);
            weaponComparer.damage_secondItem.gameObject.SetActive(false);
            weaponComparer.fireRate_secondItem.gameObject.SetActive(false);
            weaponComparer.weight_secondItem.gameObject.SetActive(false);
        }
        else if (item2 != null)
        {
            weaponComparer.accuracy_secondItem.gameObject.SetActive(true);
            weaponComparer.clipSize_secondItem.gameObject.SetActive(true);
            weaponComparer.damage_secondItem.gameObject.SetActive(true);
            weaponComparer.fireRate_secondItem.gameObject.SetActive(true);
            weaponComparer.weight_secondItem.gameObject.SetActive(true);

            tmpWeapon2 = item2.itemPrfb.GetComponent <V_Weapon>();
            StartCoroutine(UIController.FillSlider(weaponComparer.accuracy_secondItem, tmpWeapon2.accuracy / 100f));
            StartCoroutine(UIController.FillSlider(weaponComparer.clipSize_secondItem, tmpWeapon2.clipSize / 100f));
            StartCoroutine(UIController.FillSlider(weaponComparer.damage_secondItem, tmpWeapon2.damage / 100f));
            StartCoroutine(UIController.FillSlider(weaponComparer.fireRate_secondItem, tmpWeapon2.fireRate / 100f));
            StartCoroutine(UIController.FillSlider(weaponComparer.weight_secondItem, tmpWeapon2.weight / 100f));
        }
    }
Exemple #5
0
    protected void CompareGear(V_InventoryItem item1, V_InventoryItem item2)
    {
        tmpGear1 = item1.itemPrfb.GetComponent <V_Gear>();
        if (tmpGear1 == null)
        {
            UIController.ThrowError("V_Inventory_UI: CompareGear: gears are not set properly", UIController.CloseError);
            return;
        }

        UIController.Enable_DisableUI(gearComp, weaponComp, characterComp);

        if (item2 == null)
        {
            StartCoroutine(UIController.FillSlider(gearComparer.shield_firstItem, tmpGear1.shield / 100f));

            gearComparer.shield_secondItem.gameObject.SetActive(false);
        }
        else if (item2 != null)
        {
            gearComparer.shield_secondItem.gameObject.SetActive(true);
            tmpGear2 = item2.GetComponent <V_Gear>();
            StartCoroutine(UIController.FillSlider(gearComparer.shield_secondItem, tmpGear2.shield));
        }
    }
Exemple #6
0
 protected void CompareCharacter(V_InventoryItem item1, V_InventoryItem item2)
 {
 }
Exemple #7
0
 public void EquipAssault_secondary(V_InventoryItem assault_sec)
 {
 }
Exemple #8
0
 public void EquipAssault(V_InventoryItem assault)
 {
 }
Exemple #9
0
 public void EquipPistol(V_InventoryItem pistol)
 {
 }
Exemple #10
0
 public void AddToInGameInventory(V_InventoryItem item)
 {
 }