コード例 #1
0
ファイル: LGameSlot25Line.cs プロジェクト: lhp2106/unityUwin
    public void HandleLuckyGameResult(object[] data)
    {
        string json = LitJson.JsonMapper.ToJson(data[0]);
        SRSSlot25LineLuckyGameResult luckyResult = JsonUtility.FromJson <SRSSlot25LineLuckyGameResult>(json);

        if (luckyResult.ResponseStatus > 0)
        {
            if (_minigame.isPlaying)
            {
                _minigame.LoadResult(luckyResult);
            }
            if (luckyResult.Balance > 1)
            {
                Database.Instance.UpdateUserMoney(moneyType, luckyResult.Balance);
            }
        }
        else
        {
            _minigame.ClearUI();
            OnPlayLuckyGameDone();
            NotifyController.Instance.Open("Không chơi được Mini Game! xin thử lại sau!", NotifyController.TypeNotify.Error);
        }
    }
コード例 #2
0
    public void LoadResult(SRSSlot25LineLuckyGameResult result)
    {
        btNgungChoi.enabled = true;

        this.result = result;
        txtCurrentMoney.UpdateNumber(result.PrizeValue);
        txtWinMoney.UpdateNumber(result.PrizeValue * multiConfig);

        switch (result.RemainTurn)
        {
        case 3:
            gameObject.SetActive(true);
            ReloadItem();
            txtNotify.text = strFirst;
            break;

        case 2:
            txtNotify.text = result.PrizeValue > 1 ? strWin1 : strLose;
            FakeOpenItem(itemIndex);
            break;

        case 1:
            txtNotify.text = result.PrizeValue > 1 ? strWin2 : strLose;
            FakeOpenItem(itemIndex);
            break;

        case 0:
            txtNotify.text = result.PrizeValue > 1 ? strWin3 : strLose;
            FakeOpenItem(itemIndex);
            break;
        }

        if (result.PrizeValue < 1 || result.RemainTurn <= 0)
        {
            StartCoroutine(WaitHideMiniGame());
        }
    }