Esempio n. 1
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (master != null && master.playerCharacterMasterController != null)
     {
         ItemIcon  itemIcon  = GetComponent <ItemIcon>();
         ItemIndex itemIndex = itemIcon.GetFieldValue <ItemIndex>("itemIndex");
         if (ItemCatalog.GetItemDef(itemIndex).tier == ItemTier.NoTier)
         {
             Debug.LogWarning("Trash cannot be dropped :D");
             return;
         }
         if (NetworkServer.active)
         {
             ServerStuffDropper.DropItem(master, itemIndex);
             InventoryLimits limits = master.GetComponent <InventoryLimits>();
             if (!limits)
             {
                 return;
             }
             limits.Count(master.inventory);
         }
         else
         {
             if (ClientScene.readyConnection == null)
             {
                 Debug.LogError("Connection is not ready.");
             }
             ClientScene.readyConnection.Send(ConversionArtifactMod.msgItemDropType, new ItemDropMessage(itemIndex));
         }
     }
 }
Esempio n. 2
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (master != null && master.playerCharacterMasterController != null)
     {
         EquipmentIcon equipmentIcon = GetComponent <EquipmentIcon>();
         if (!equipmentIcon.hasEquipment)
         {
             return;
         }
         EquipmentIndex equipmentIndex = equipmentIcon.targetEquipmentSlot.equipmentIndex;
         if (NetworkServer.active)
         {
             ServerStuffDropper.DropEquipment(master, equipmentIndex);
         }
         else
         {
             if (ClientScene.readyConnection == null)
             {
                 Debug.LogError("Connection is not ready.");
             }
             ClientScene.readyConnection.Send(ConversionArtifactMod.msgEquipmentDropType, new EquipmentDropMessage(equipmentIndex));
         }
     }
 }