Exemplo n.º 1
0
        public void SwitchMode(SlotMode mode = null)
        {
            if (mode == null)
            {
                mode = current;
                if (mode == bonusMode)
                {
                    if (slot.gameInfo.bonuses == 0)
                    {
                        mode = freeSpinMode;
                    }
                }
                if (mode == freeSpinMode)
                {
                    if (slot.gameInfo.bonuses > 0)
                    {
                        mode = bonusMode;
                    }
                    else if (slot.gameInfo.freeSpins == 0)
                    {
                        mode = defaultMode;
                    }
                }
                if (mode == defaultMode)
                {
                    if (slot.gameInfo.bonuses > 0)
                    {
                        mode = bonusMode;
                    }
                    else if (slot.gameInfo.freeSpins > 0)
                    {
                        mode = freeSpinMode;
                    }
                }
            }

            if (mode != current)
            {
                slot.symbolManager.ApplySymbolMap(cleanMap, mode.symbolSwaps);
                SlotModeInfo info = new SlotModeInfo(current);
                current = mode;
                slot.callbacks.onSlotModeChange.Invoke(info);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// A callback method subscribed to CS's onSlotModeChange event.
 /// It is invoked when CS's mode changes(e.g going to free spin mode).
 /// </summary>
 public virtual void OnSlotModeChange(SlotModeInfo info)
 {
     ShowDebugText("onSlotModeChange");
     if (info.lastMode == slot.modes.freeSpinMode)
     {
         ToggleFreeSpin(false);
     }
     if (info.lastMode == slot.modes.bonusMode)
     {
         ToggleBonus(false);
     }
     if (slot.currentMode == slot.modes.freeSpinMode)
     {
         ToggleFreeSpin(true);
     }
     if (slot.currentMode == slot.modes.bonusMode)
     {
         ToggleBonus(true);
     }
     RefreshFreeSpin();
     RefreshBonus();
 }