示例#1
0
 void OnWin()
 {
     if (IsWin)
     {
         if (DGameData.Instance.WinMoney > 0)
         {
             //1分1分的从赢的分数加到用户分数
             DGameData.Instance.WinMoney -= 10;
             DGameData.Instance.Fraction += 10;
             wining.SetActive(true);
         }
         else
         {
             wining.SetActive(false);
             DGameData.Instance.IsBiBei     = false;
             DGameData.Instance.str_result  = new string[6];
             DGameData.Instance.IsWinEffect = false;
             if (DGameData.Instance.BiType == 2)
             {
                 DGameData.Instance.BiType = 0;
             }
             else
             {
                 Invoke("OnCardStart", 0.5f);
             }
             for (int i = 0; i < 10; i++)
             {
                 OddListObj[i].SetActive(true);
             }
             winEffectIng.SetActive(false);
             IsWin   = false;
             IsBiBei = false;
             DGameData.Instance.IsWin = false;
             WinButton.SetActive(false);
             StartButton.SetActive(true);
             FillButton.SetActive(true);
             BanBiButton.SetActive(false);
             BiButton.SetActive(false);
             ShuangBiButton.SetActive(false);
             SmallButton.SetActive(true);
             BigButton.SetActive(true);
             DGameData.Instance.HoldData = new string[5];
         }
     }
 }
示例#2
0
    IEnumerator SendBiBei(string url)
    {
        UnityWebRequest www = UnityWebRequest.Get(url);

        Debug.Log(url);
        yield return(www.Send());

        try
        {
            if (www.error == null && www.isDone)
            {
                if (www.responseCode == 200)
                {
                    JsonData jd = JsonMapper.ToObject(www.downloadHandler.text);

                    IsBiBei = true;
                    DGameData.Instance.BiType = 2;
                    Debug.Log("执行3");
                    FillButton.SetActive(false);
                    BiButton.SetActive(false);
                    BanBiButton.SetActive(false);
                    ShuangBiButton.SetActive(false);
                    SmallButton.SetActive(true);
                    BigButton.SetActive(true);
                    StartButton.SetActive(false);
                    WinButton.SetActive(true);
                    DGameData.Instance.IsColumnBoard = true;

                    for (int i = 0; i < 6; i++)
                    {
                        DGameData.Instance.str_result[i] = jd["result"][i].ToString();
                        Debug.Log("右边的牌为第" + (i + 1) + "张:" + DGameData.Instance.str_result[i]);
                    }
                }
            }
        }
        catch
        {
            Debug.Log("Json解析错误");
            DGameData.Instance.IsNetworkError = true;
        }
    }
示例#3
0
    IEnumerator WinCorutine()
    {
        yield return(new WaitForSeconds(1));

        WinScreen_Panel.SetActive(true);
        WinButton.SetActive(false);
        yield return(new WaitForSeconds(0.3f));

        WinTime_TXT.text = ((int)(Time.timeSinceLevelLoad)).ToString();
        int index = PlayersScore.FindIndex(PlayersScore => PlayersScore.name == PhotonNetwork.NickName);

        yield return(new WaitForSeconds(0.3f));

        WinPrize_TXT.text = PlayersScore[index].score.ToString();
        yield return(new WaitForSeconds(0.3f));

        WinRound_TXT.text = MaxRound.ToString();
        MyPlayerUsername  = PhotonNetwork.NickName;
        WinButton.SetActive(true);
    }
示例#4
0
    void OnUI()
    {
        switch (DGameData.Instance.FlopNum)
        {
        case 1:
            PromptText.GetComponent <Text>().text = "<color=#FFFF00>押 注 </color>或 <color=#458b00>开 始</color>";
            break;

        case 2:
            PromptText.GetComponent <Text>().text = "<color=#458b00>保 留 </color>或 <color=#458b00>开 牌</color>";
            break;

        case 3:
            if (DGameData.Instance.WinMoney != 0)
            {
                PromptText.GetComponent <Text>().text = "<color=#458b00>得 分 </color>或 <color=#458b00>比 倍</color>";
            }
            else
            {
                PromptText.GetComponent <Text>().text = "<color=#458b00>保 留 </color>或 <color=#458b00>开 牌</color>";
            }
            break;
        }

        if (isQuitPanel)
        {
            QuitPanel.SetActive(true);
        }
        else
        {
            QuitPanel.SetActive(false);
        }
        if (isStopPanel)
        {
            StopPanel.SetActive(true);
        }
        else
        {
            StopPanel.SetActive(false);
        }
        if (isUpDownPanel)
        {
            UpDownPanel.SetActive(true);
        }
        else
        {
            UpDownPanel.SetActive(false);
        }
        if (isRecordPanel)
        {
            RecordPanel.SetActive(true);
        }
        else
        {
            RecordPanel.SetActive(false);
        }
        if (isRankingPanel)
        {
            RankingPanel.SetActive(true);
        }
        else
        {
            RankingPanel.SetActive(false);
        }

        for (int i = 0; i < 10; i++)
        {
            if (DGameData.Instance.ChargeNum != 0)
            {
                OddList[i].text = (DGameData.Instance.OddList[i] * DGameData.Instance.ChargeNum).ToString();
            }
            else
            {
                OddList[i].text = DGameData.Instance.OddList[i].ToString();
            }
        }

        AllScore.text = LoginInfo.Instance().mylogindata.ALLScroce;
        Fraction.text = DGameData.Instance.Fraction.ToString(); Fraction2.text = DGameData.Instance.Fraction.ToString();
        WinMoney.text = DGameData.Instance.WinMoney.ToString();
        BET.text      = DGameData.Instance.ChargeNum.ToString();

        if (DGameData.Instance.IsWin)
        {
            if (DGameData.Instance.BiType == 2)
            {
                FillButton.SetActive(true);
            }
            else
            {
                SmallButton.SetActive(false);
                BigButton.SetActive(false);
                FillButton.SetActive(false);
                BiButton.SetActive(true);
                BanBiButton.SetActive(true);
                ShuangBiButton.SetActive(true);
            }
            StartButton.SetActive(false);
            WinButton.SetActive(true);
        }
        else
        {
            WinButton.SetActive(false);
            StartButton.SetActive(true);
            FillButton.SetActive(true);
            SmallButton.SetActive(true);
            BigButton.SetActive(true);
            BiButton.SetActive(false);
            BanBiButton.SetActive(false);
            ShuangBiButton.SetActive(false);
        }
    }