Пример #1
0
 private bool CheckIsSlotEmpty()
 {
     if (_currentSlot.ReturnCountObject() <= 0 || _currentSlot.ReturnSprite() == null || _currentSlot.ReturnPrefab() == null)
     {
         SetMaxValueSlider(0);
         SetImageDrop(null, false);
         return(true);
     }
     return(false);
 }
Пример #2
0
 public void SetObjectIsExist(ScriptableObject scriptableObject, Sprite spriteObj, float countObj)
 {
     if (CheckObjectItExist(scriptableObject, spriteObj, slotToolBar) != null)
     {
         SlotController slotController = CheckObjectItExist(scriptableObject, spriteObj, slotToolBar).GetComponent <SlotController>();
         slotController.SetCount(slotController.ReturnCountObject() + countObj);
         //SendToServerObjectToolBar(slotController, scriptableObject, spriteObj, countObj);
     }
     else if (CheckObjectItExist(scriptableObject, spriteObj, slotEquipmentBox) != null)
     {
         SlotController slotController = CheckObjectItExist(scriptableObject, spriteObj, slotEquipmentBox).GetComponent <SlotController>();
         slotController.SetCount(slotController.ReturnCountObject() + countObj);
         //SendToServerObjectToolBar(slotController, scriptableObject, spriteObj, countObj);
     }
 }
Пример #3
0
    private void DropObjectFromSlotMirror(SlotController slotController)
    {
        if (slotController != null)
        {
            if (slotController.ReturnPrefab() != null || slotController.ReturnSprite() != null || slotController.ReturnCountObject() > 0)
            {
                PlayerMirrorController playerMirrorController = this.gameObject.transform.root.GetComponent <PlayerMirrorController>();
                if (playerMirrorController != null)
                {
                    playerMirrorController.DropObjectServer(slotController.ReturnPrefab().name, CalculateInstantiateObjectDrop(), slotController.ReturnCountObject());
                    playerMirrorController.DestoryAllObjectInHandServer();
                }


                slotController.SetCount(0);
                slotController.SetPrefab(null);
                slotController.SetSprite(null, false);
            }
        }
    }