public void SetObjectIsHavePlace(ScriptableObject scriptableObject, Sprite spriteObj, float countObj) { if (FindSortEquipObject(slotToolBar) != null) { SlotController slotController = FindSortEquipObject(slotToolBar).GetComponent <SlotController>(); slotController.SetPrefab(scriptableObject); slotController.SetSprite(spriteObj, true); slotController.SetCount(countObj); //SendToServerObjectToolBar(slotController, scriptableObject, spriteObj, countObj); } else if (FindSortEquipObject(slotEquipmentBox) != null) { SlotController slotController = FindSortEquipObject(slotEquipmentBox).GetComponent <SlotController>(); slotController.SetPrefab(scriptableObject); slotController.SetSprite(spriteObj, true); slotController.SetCount(countObj); //SendToServerObjectToolBar(slotController, scriptableObject,spriteObj,countObj); } }
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); } } }