public void CheckTheTriggerKey()
 {
     foreach (GameObject slotControllerObj in SlorControllerToolBar)
     {
         SlotController slotControllerCheck = slotControllerObj.GetComponent <SlotController>();
         if (slotControllerCheck.ReturnKeyCodeObject() == KeyCode.None)
         {
             return;
         }
         else
         {
             if (Input.GetKeyDown(slotControllerCheck.ReturnKeyCodeObject()))
             {
                 foreach (var scriptableObject in ((NetworkRoomManagerExt)NetworkManager.singleton).scriptableObjectToMirror.Select(((value, index) => new { value, index })))
                 {
                     if (slotControllerCheck.ReturnPrefab() == null)
                     {
                         DestoryAllObjectInHandServer(); PlayerController.SetBasicSpeed(); PlayerController.SetDefaultSpeedToVariableCalculate(); return;
                     }
                     else if (scriptableObject.value.name == slotControllerCheck.ReturnPrefab().name)
                     {
                         DestoryAllObjectInHandServer();
                         SendSlotControllerToObjectServer(scriptableObject.index);
                         continue;
                     }
                 }
             }
         }
     }
 }
Пример #2
0
 private bool CheckIsSlotEmpty()
 {
     if (_currentSlot.ReturnCountObject() <= 0 || _currentSlot.ReturnSprite() == null || _currentSlot.ReturnPrefab() == null)
     {
         SetMaxValueSlider(0);
         SetImageDrop(null, false);
         return(true);
     }
     return(false);
 }
Пример #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);
            }
        }
    }
Пример #4
0
 private GameObject FindSortEquipObject(List <GameObject> listGameObject)
 {
     foreach (GameObject slotControllerObj in listGameObject)
     {
         SlotController slotController = slotControllerObj.GetComponent <SlotController>();
         if (slotController.ReturnPrefab() == null && slotController.ReturnSprite() == null)
         {
             return(slotControllerObj);
         }
     }
     return(null);
 }
Пример #5
0
 private GameObject CheckObjectItExist(ScriptableObject gameObject, Sprite sprite, List <GameObject> listGameObject)
 {
     foreach (GameObject slotControllerObj in listGameObject)
     {
         SlotController slotController = slotControllerObj.GetComponent <SlotController>();
         if (slotController.ReturnPrefab() == gameObject && slotController.ReturnSprite() == sprite)
         {
             return(slotControllerObj);
         }
     }
     return(null);
 }