Пример #1
0
    public int GetItemTotalPrice(InventoryItemObject item)
    {
        if (!IsShopActive())
        {
            //Debug.Log ("shop is not active");
            return(item.info.costInfo.timePrice);
        }
        Transform slot = item.GetSlot();

        if (slot == null)
        {
            return(0);
        }
        WagonInventoryUI inventory = slot.parent.parent.GetComponent <WagonInventoryUI>();

        if (inventory == shopInventory)
        {
            return(item.GetBuyPrice());
        }
        else
        {
            if (vendorShopInfo.FindInfoByIndex(item.info.databaseIndex) != null)
            {
                return(item.GetSellPrice());
            }
            else
            {
                //Debug.Log ("vendor is not interested");
                return(0);
            }
        }
    }
	bool HavePenaltyDurability(InventoryItemObject item)
	{
		if (PlayerSaveData.reference.trainData.bonusEquipmentDurability >= 0)
			return false;
		if (InventorySystem.reference.GetSlotInfo (item.GetSlot ()).type == InventorySystem.SlotType.Shop)
			return false;
		return true;
	}
Пример #3
0
 bool HavePenaltyDurability(InventoryItemObject item)
 {
     if (PlayerSaveData.reference.trainData.bonusEquipmentDurability >= 0)
     {
         return(false);
     }
     if (InventorySystem.reference.GetSlotInfo(item.GetSlot()).type == InventorySystem.SlotType.Shop)
     {
         return(false);
     }
     return(true);
 }
Пример #4
0
	public int GetItemTotalPrice(InventoryItemObject item)
	{
		if (!IsShopActive ())
		{
			//Debug.Log ("shop is not active");
			return item.info.costInfo.timePrice;
		}
		Transform slot = item.GetSlot();
		if (slot == null)
			return 0;
		WagonInventoryUI inventory = slot.parent.parent.GetComponent<WagonInventoryUI>();
		if (inventory == shopInventory) 
		{
			return item.GetBuyPrice ();
		}
		else
		{
			if (vendorShopInfo.FindInfoByIndex (item.info.databaseIndex) != null)
			{
				return item.GetSellPrice ();
			}
			else
			{
				//Debug.Log ("vendor is not interested");
				return 0;
			}
		}
	}