private bool CheckIsSlotEmpty() { if (_currentSlot.ReturnCountObject() <= 0 || _currentSlot.ReturnSprite() == null || _currentSlot.ReturnPrefab() == null) { SetMaxValueSlider(0); SetImageDrop(null, false); return(true); } return(false); }
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); }
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); }
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); } } }