Exemple #1
0
        private void OnSlotTap(KulaySlot slot)
        {
            if (_boardBusy)
            {
                return;
            }

            if (Manager.Board.PowerUps.OnEffect)
            {
                _powerUpHandler.Execute(Manager.Board.PowerUps.Consume(), slot.SlotIndex, _slots, _gridSideCount, _boosterHandler);
            }
            else if (slot.IsBoostSlot)
            {
                _boosterHandler.ExecuteBooster(slot, _slots, _gridSideCount);
            }
            else
            if (PopSingleSlot(slot))
            {
                return;
            }

            _boardBusy = true;
            Action moveSlot = MoveSlots;

            moveSlot.DelayInvoke(0.8f);
        }
Exemple #2
0
        private bool PopSingleSlot(KulaySlot slot)
        {
            var chainCount = ChainPop(slot, new List <int>(slot.SlotIndex));

            if (chainCount <= 1)
            {
                _boardBusy = false;
                return(true);
            }

            if (chainCount == 5)
            {
                slot.SetBooster(BoosterType.Slice);
            }
            else if (chainCount == 6)
            {
                slot.SetBooster(BoosterType.Burst);
            }
            else if (chainCount >= 7)
            {
                slot.SetBooster(BoosterType.SameSlot);
            }
            else
            {
                slot.Pop();
            }
            return(false);
        }