示例#1
0
 // Update is called once per frame
 void Update()
 {
     if (over)
     {
         if (!isInventory)
         {
             if (isSell && SellUi.player.inventory[itemindex].item.itemvalue > 0)
             {
                 if (Input.GetKeyDown("c"))
                 {
                     if (SellUi.player.inventory[itemindex].amount > 0)
                     {
                         SellUi.AddGold(EachValue);
                         SellUi.SellOne(itemindex);
                         SellUi.RefreshSellInventory();
                     }
                 }
                 if (Input.GetMouseButtonDown(1))
                 {
                     SellUi.AddGold(TotalValue);
                     SellUi.SellAll(itemindex);
                     SellUi.RefreshSellInventory();
                 }
             }
             else
             {
                 if (Input.GetKeyDown("c"))
                 {
                     BuyUi.BuyFive(itemindex);
                 }
                 if (Input.GetMouseButtonDown(1))
                 {
                     BuyUi.Buy(itemindex);
                 }
             }
         }
         else
         {
             if (Input.GetMouseButtonDown(1))
             {
                 InventoryUi.ToggleEquip(itemindex);
             }
         }
     }
     else
     {
     }
 }
示例#2
0
 public void EndDialog()
 {
     if (DialogType == 0)
     {
         InTrade = true;
         SellUi.gameObject.GetComponent <Canvas>().enabled = true;
         InventoryUi.CloseInventory();
         SellUi.RefreshSellInventory();
         InventoryUi.gameObject.GetComponent <Canvas>().enabled = false;
     }
     if (DialogType == 1)
     {
         InShop = true;
         BuyUi.gameObject.GetComponent <Canvas>().enabled = true;
         InventoryUi.CloseInventory();
         BuyUi.RefreshBuyInventory();
         InventoryUi.gameObject.GetComponent <Canvas>().enabled = false;
     }
     DialogUi.GetComponent <Canvas>().enabled = false;
     StartCoroutine(AntiDialogSpam());
     DialogIndex = 0;
 }
示例#3
0
 public void PickUpItem(Item item, float amount)
 {
     if (item.itemspriteid != 4)
     {
         AddToInventory(item, amount);
     }
     else
     {
         if (item.itemspriteid == 4)
         {
             gold += amount;
         }
     }
     if (InventoryUi.enabled)
     {
         InventoryUi.gameObject.GetComponent <InventoryUiScript>().RefreshInventory();
     }
     if (dialogmanager.InTrade)
     {
         SellUi.RefreshSellInventory();
     }
     BuyUi.RefreshBuyInventory();
     InventoryUi.GetComponent <InventoryUiScript>().DrawInventory();
 }