public void InitHistory(SRSSlot25LineConfig config, string data)
    {
        this._config = config;

        gHistoryContent.SetActive(true);
        itemHistoryInPage = uiHistoryItems.Count;

        try
        {
            histories = LitJson.JsonMapper.ToObject <List <SRSSlot25LineHistory> >(data);
        }
        catch
        {
            histories = new List <SRSSlot25LineHistory>();
        }

        int maxPage = Mathf.CeilToInt(((float)histories.Count) / itemHistoryInPage);

        vkHistoryPageController.InitPage(maxPage, OnSelectPageHistory);

        uiHistoryItems.ForEach(a => a.gameObject.SetActive(false));

        if (histories.Count > 0)
        {
            OnSelectPageHistory(1);
        }
    }
    public void InitJackpot(SRSSlot25LineConfig config, string data, Action <int> changePageCallback)
    {
        this._config = config;

        gJackpotContent.SetActive(true);
        onChangePageJackpotCallback = changePageCallback;

        LoadPageJackpotData(data);

        int maxPage = Mathf.CeilToInt(((float)jackpot.TotalRecord) / uiJackpotItems.Count);

        vkJackpotPageController.InitPage(maxPage, OnSelectPageJackpot);
    }
    public void Init(SRSSlot25LineConfig config, SRSSlot25LineBonusGame bonusGame, int betValue, Action callback)
    {
        ClearUI();
        this._config = config;

        this.bonusGame    = bonusGame;
        this.bonusItems   = bonusGame.GetItems();
        this.ResultAction = callback;
        this.betValue     = betValue;

        vkCountDown.StartCoundown(timeAutoOpen);

        SetTotalWin();
    }
    public void InitSelectLine(SRSSlot25LineConfig config, List <int> lines, Action <List <int> > callback)
    {
        _config = config;

        gSelectLineContent.SetActive(true);
        onSelectLineCallBack = callback;
        lineSelecteds        = lines;

        VKDebug.LogWarning("LINE " + lines.Count);
        foreach (var uiLine in uiLineItems)
        {
            uiLine.SetSelected(lines.Contains(uiLine.id));
        }

        SetupButtonTab();
    }
Exemple #5
0
    public void Init(SRSSlot25LineConfig config, Slot25lineSignalRServer server, SRSSlot25LineAccount account, AssetBundleSettingItem assetBundleConfig, int roomId, int mType)
    {
        ClearUI();

        _config               = config;
        _server               = server;
        _server.OnSRSEvent    = OnSRSEvent;
        _server.OnSRSHubEvent = OnSRSHubEvent;

        _assetBundleConfig = assetBundleConfig;
        _settingSound      = AudioAssistant.Instance.GetSettingSound(_config.gameId);

        this.accountSpin = account;
        this.accountInfo = Database.Instance.Account();

        this.roomBetId    = roomId;
        this.moneyType    = mType;
        this.roomBetValue = accountSpin.RoomBetValue(roomBetId);

        txtRomBet.SetNumber(roomBetValue);

        SetNotifyFree();
        SetLineSelected(account.GetLineData());

        // event
        OnEventUpdate();

        // update jackpot
        if (_server.jackpots.ContainsKey(roomBetId.ToString()))
        {
            jackpot = _server.jackpots[roomBetId.ToString()];
            UpdateJackpot();
        }

        // Set data
        imgIconMoney.sprite = sprIconMoney[moneyType == MoneyType.GOLD ? 0 : 1];
        vkTxtMyMoney.SetNumber(accountInfo.GetCurrentBalance(moneyType));

        // finish bonus
        if (account.BonusSpinId > 0)
        {
            _server.HubCallFinishBonusGame(moneyType, account.BonusSpinId);
        }
    }
    public void InitTutorial(SRSSlot25LineConfig config, double jackpot)
    {
        _config = config;

        gTutorialContent.SetActive(true);
        for (int i = 0; i < listObjPage.Count; i++)
        {
            if (i == 0)
            {
                listObjPage[i].SetActive(true);
            }
            else
            {
                listObjPage[i].SetActive(false);
            }
        }

        txtNumberPage.text = "Trang 0";
    }
 public void Init(SRSSlot25LineConfig config)
 {
     _config   = config;
     isPlaying = true;
 }
    public void Init(Slot25LineWinType type, SRSSlot25LineConfig config, Action callback = null, double money = -1)
    {
        ClearUI();
        this._config  = config;
        this.callback = callback;

        int autoHide = 5;

        switch (type)
        {
        case Slot25LineWinType.JACKPOT:
            gObjJackpot.SetActive(true);
            autoHide = autoHideJackpot;

            txtMoneyJackpot.SetNumber(0);
            txtMoneyJackpot.SetTimeRun(_config.audioMoney.length);
            txtMoneyJackpot.UpdateNumber(money);

            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioMoney);
            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioJackpot);

            break;

        case Slot25LineWinType.BIGWIN:
            gObjBigWin.SetActive(true);
            autoHide = autoHideBigWin;

            txtMoneyBigWin.SetNumber(0);
            txtMoneyBigWin.SetTimeRun(_config.audioMoney.length);
            txtMoneyBigWin.UpdateNumber(money);

            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioMoney);
            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioBigWin);

            break;

        case Slot25LineWinType.PERFECT:
            gObjPerfect.SetActive(true);
            autoHide = autoHidePerfect;

            txtMoneyPerfect.SetNumber(0);
            txtMoneyPerfect.SetTimeRun(_config.audioMoney.length);
            txtMoneyPerfect.UpdateNumber(money);

            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioMoney);
            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioPerfect);

            break;

        case Slot25LineWinType.FREE:
            gObjFree.SetActive(true);
            autoHide = autoHideFree;

            txtFree.text = money.ToString("F0");
            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioFree);

            break;

        case Slot25LineWinType.BONUS:
            gObjBonus.SetActive(true);
            autoHide = autoHideBonus;

            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioBonus);

            break;

        case Slot25LineWinType.FINISH_BONUS:
            gObjBonusFinish.SetActive(true);
            autoHide = autoHideFinishBonus;

            txtMoneyBonusFinish.SetNumber(0);
            txtMoneyBonusFinish.SetTimeRun(_config.audioMoney.length);
            txtMoneyBonusFinish.UpdateNumber(money);

            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioMoney);
            AudioAssistant.Instance.PlaySoundGame(_config.gameId, _config.audioWin);

            break;
        }

        vkCountDown.OnCountDownComplete = OnCountDownDone;
        vkCountDown.StartCoundown(autoHide);
    }