void Close_OnClick()
 {
     JurassicManager.page = 0;
     GameConnet.CloseGameConnet();
 }
 void OnClick()
 {
     if (ButtonID == ENUM_LOBBY_BUTTON.SmallTable)
     {
         if (!Competition.SinedOK_Bool)
         {
             if (MainConnet.m_PlayerData.m_usLv >= BaccaratManager.m_MachineBuyInConfig.m_usBuyinLv)
             {
                 AllScenceLoad.LoadScence        = true;
                 AutoButton_Control.ClickGroupID = TableID;
                 CPACK_TMachineAutoSelect Data = new CPACK_TMachineAutoSelect();
                 Data.m_uiStartTID = BaccaratManager.m_MachineBuyInConfig.m_dicTableGroupSet[AutoButton_Control.ClickGroupID].m_uiStartTableID;
                 Data.m_uiEndTID   = BaccaratManager.m_MachineBuyInConfig.m_dicTableGroupSet[AutoButton_Control.ClickGroupID].m_uiEndTableID;
                 Debug.Log("小底台" + "StartID: " + Data.m_uiStartTID + " //EndID: " + Data.m_uiEndTID);
                 GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.Baccarat, (uint)ENUM_COMMON_PACKID_GC.C2G_TMachine_AutoSelect, GameConnet.m_oGameClient.DoSerialize <CPACK_TMachineAutoSelect>(Data));
             }
             else
             {
                 Message_Control.OpenMessage   = true;
                 Message_Control.MessageSize   = Message_Control.BoxSizeStatu.Box_S_Yes;
                 Message_Control.MessageStatus = Message_Control.MessageStatu.RookiePlayerCanNotEnter;
             }
         }
         else
         {
             Message_Control.OpenMessage   = true;
             Message_Control.MessageSize   = Message_Control.BoxSizeStatu.Box_S_Yes;
             Message_Control.MessageStatus = Message_Control.MessageStatu.NowRace;
         }
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.BigTable)
     {
         if (!Competition.SinedOK_Bool)
         {
             if (MainConnet.m_PlayerData.m_usLv >= BaccaratManager.m_MachineBuyInConfig.m_usBuyinLv)
             {
                 AllScenceLoad.LoadScence        = true;
                 AutoButton_Control.ClickGroupID = TableID;
                 CPACK_TMachineAutoSelect Data = new CPACK_TMachineAutoSelect();
                 Data.m_uiStartTID = BaccaratManager.m_MachineBuyInConfig.m_dicTableGroupSet[AutoButton_Control.ClickGroupID].m_uiStartTableID;
                 Data.m_uiEndTID   = BaccaratManager.m_MachineBuyInConfig.m_dicTableGroupSet[AutoButton_Control.ClickGroupID].m_uiEndTableID;
                 Debug.Log("大底台: " + Data.m_uiStartTID + " //EndID: " + Data.m_uiEndTID);
                 GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.Baccarat, (uint)ENUM_COMMON_PACKID_GC.C2G_TMachine_AutoSelect, GameConnet.m_oGameClient.DoSerialize <CPACK_TMachineAutoSelect>(Data));
             }
             else
             {
                 Message_Control.OpenMessage   = true;
                 Message_Control.MessageSize   = Message_Control.BoxSizeStatu.Box_S_Yes;
                 Message_Control.MessageStatus = Message_Control.MessageStatu.RookiePlayerCanNotEnter;
             }
         }
         else
         {
             Message_Control.OpenMessage   = true;
             Message_Control.MessageSize   = Message_Control.BoxSizeStatu.Box_S_Yes;
             Message_Control.MessageStatus = Message_Control.MessageStatu.NowRace;
         }
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.GameOutButton)
     {
         GameConnet.CloseGameConnet();
         Competition.CompetitionData.Clear();
         Competition.SequenceData.Clear();
         Competition.ListObject.Clear();
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.ExplainButton)
     {
         if (!Explain.ExplainBoxOpen_Bool)
         {
             Explain.ExplainBoxOpen_Bool = true;
         }
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.CompetitionButton)
     {
         if (!Competition.CompetitionBoxOpen_Bool)
         {
             Competition.CompetitionBoxOpen_Bool = true;
         }
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.ExplainNextButton)
     {
         if (Explain.Page_Number > 5)
         {
             Explain.Page_Number = 1;
         }
         else
         {
             Explain.Page_Number++;
         }
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.ExplainBackButton)
     {
         if (Explain.Page_Number < 2)
         {
             Explain.Page_Number = 6;
         }
         else
         {
             Explain.Page_Number--;
         }
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.ExplainCloseButton)
     {
         Explain.ExplainBoxOpen_Bool = false;
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.CompetitionClose)
     {
         Competition.CompetitionBoxOpen_Bool = false;
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.BeforeRankingClose)
     {
         Competition.BeforeRankingBoxOpen_Bool = false;
     }
     else if (ButtonID == ENUM_LOBBY_BUTTON.RaceInfoClose)
     {
         RaceInfo.RaceInfoObject_bool = false;
     }
 }
    void OnClick()
    {
        if (!Cash_Control.OnBetClick)
        {
            //錢幣
            #region Coin
            if (ButtonList_Control == ButtonList.Coin1)
            {
                BJMainGame_Control.SelectCoin = 1000;
            }
            else if (ButtonList_Control == ButtonList.Coin2)
            {
                BJMainGame_Control.SelectCoin = 5000;
            }
            else if (ButtonList_Control == ButtonList.Coin3)
            {
                BJMainGame_Control.SelectCoin = 10000;
            }
            else if (ButtonList_Control == ButtonList.Coin4)
            {
                BJMainGame_Control.SelectCoin = 100000;
            }
            #endregion

            //押注確定,取消
            #region Enter_Cancel
            if (ButtonList_Control == ButtonList.BetEnter)
            {
                if (Cash_Control.TableCash[0] != 0)
                {
                    CPACK_BlackJack_ReqBet Data = new CPACK_BlackJack_ReqBet();
                    Data.m_iAddBet = (int)Cash_Control.TableCash[0];

                    GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.BlackJack, (uint)ENUM_BlackJack_PACKID_GC.C2G_Game_ReqBet, GameConnet.m_oGameClient.DoSerialize <CPACK_BlackJack_ReqBet>(Data));
                    Cash_Control.OnBetClick = true;
                }
            }
            else if (ButtonList_Control == ButtonList.BetCancel)
            {
                if (!BJMainGame_Control.BetCancel_Bool)
                {
                    BJMainGame_Control.BetCancel_Bool = true;
                }
            }
            #endregion

            //要牌,加倍押注,要牌結束,投降,分牌
            #region Bet
            if (ButtonList_Control == ButtonList.Deal)
            {
                GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.BlackJack, (uint)ENUM_BlackJack_PACKID_GC.C2G_Game_HIT, null);
                Cash_Control.OnBetClick = true;
            }
            if (ButtonList_Control == ButtonList.Double)
            {
                GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.BlackJack, (uint)ENUM_BlackJack_PACKID_GC.C2G_Game_DOUBLE, null);
                Cash_Control.OnBetClick = true;
            }
            if (ButtonList_Control == ButtonList.DealEnd)
            {
                GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.BlackJack, (uint)ENUM_BlackJack_PACKID_GC.C2G_Game_STAND, null);
                Cash_Control.OnBetClick = true;
            }
            if (ButtonList_Control == ButtonList.Capitulate)
            {
                GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.BlackJack, (uint)ENUM_BlackJack_PACKID_GC.C2G_Game_SURRENDER, null);
                Cash_Control.OnBetClick = true;
                Debug.Log("投降按鈕");
            }
            //分牌
            if (ButtonList_Control == ButtonList.Scoreboard)
            {
                if (((long)BJMainGame_Control.MyMoney - (BJMainGame_Control.BetMoney * 2)) >= 0)
                {
                    GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.BlackJack, (uint)ENUM_BlackJack_PACKID_GC.C2G_Game_SPLIT, null);
                    Cash_Control.OnBetClick = true;
                }
                else
                {
                    Message_Control.OpenMessage   = true;
                    Message_Control.MessageStatus = Message_Control.MessageStatu.NoBetMoney;
                }
                Debug.Log("分牌按鈕");
            }
            if (ButtonList_Control == ButtonList.NoScoreboard)
            {
                ButtonSprite_Control.Scoreboard_Bool = false;
            }
            //報到
            if (ButtonList_Control == ButtonList.BJ21)
            {
                GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.BlackJack, (uint)ENUM_BlackJack_PACKID_GC.C2G_Game_BLACKJACK, null);
                Cash_Control.OnBetClick = true;
                Debug.Log("報到按鈕");
            }
            if (ButtonList_Control == ButtonList.NoBJ21)
            {
                ButtonSprite_Control.BJ21_Bool = false;
            }
            //保險
            if (ButtonList_Control == ButtonList.BetInsure)
            {
                GameConnet.m_oGameClient.Send(ENUM_GAME_FRAME.BlackJack, (uint)ENUM_BlackJack_PACKID_GC.C2G_Game_INSURE, null);
                Cash_Control.OnBetClick = true;
                Debug.Log("保險按鈕");
            }
            if (ButtonList_Control == ButtonList.NoInsure)
            {
                BJMainGame_Control.NowStateSave = ENUM_BLACKJACK_TABLE_STATE.InsuranceOver;
                BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState = ENUM_BLACKJACK_TABLE_STATE.InsuranceOver;
                ButtonSprite_Control.BetInsure_Bool = false;
            }
            #endregion

            //UI相關
            #region UI
            if (ButtonList_Control == ButtonList.Back)
            {
                GameConnet.BuyOut_GameLobbySuccess = true;
            }
            if (ButtonList_Control == ButtonList.InformationOpen)
            {
                if (!BJHistory_Control.HistoryOpen_Bool)
                {
                    BJHistory_Control.HistoryOpen_Bool  = true;
                    BJHistory_Control.PagePlanning_Bool = true;
                }
                else
                {
                    BJHistory_Control.HistoryOpen_Bool = false;
                }

                BJHelp.BJHelpOpen_Bool = false;
                BJHelp.BarOpen_Bool    = false;
            }
            if (ButtonList_Control == ButtonList.InformationCancel)
            {
                BJHistory_Control.HistoryOpen_Bool = false;
                BJHelp.BJHelpOpen_Bool             = false;
            }
            if (ButtonList_Control == ButtonList.InformationNext)
            {
                if (!BJHistory_Control.PagePlanning_Bool)
                {
                    if ((BJHistory_Control.HistoryPage + 1) > ((uint)BJHistory_Control.History_Dic.Count / 8) + 1)
                    {
                        BJHistory_Control.HistoryPage = 1;
                    }
                    else
                    {
                        BJHistory_Control.HistoryPage++;
                    }
                    BJHistory_Control.PagePlanning_Bool = true;
                }
            }
            if (ButtonList_Control == ButtonList.InformationBack)
            {
                if (!BJHistory_Control.PagePlanning_Bool)
                {
                    if ((BJHistory_Control.HistoryPage - 1) < 1)
                    {
                        BJHistory_Control.HistoryPage = 1;
                    }
                    else
                    {
                        BJHistory_Control.HistoryPage--;
                    }
                    BJHistory_Control.PagePlanning_Bool = true;
                }
            }
            #endregion

            //押注
            #region Bet
            if (ButtonList_Control == ButtonList.OnBet)
            {
                if ((BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState == ENUM_BLACKJACK_TABLE_STATE.NewRound ||
                     BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState == ENUM_BLACKJACK_TABLE_STATE.WaitBet ||
                     BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState == ENUM_BLACKJACK_TABLE_STATE.ShuffleNewRound) && !BJMainGame_Control.EnterBetBool)
                {
                    if (((long)BJMainGame_Control.MyMoney - (BJMainGame_Control.BetMoney + BJMainGame_Control.SelectCoin) >= 0))
                    {
                        Cash_Control.TableCash[0] += BJMainGame_Control.SelectCoin;
                        //  Cash_Control.OnBetClick = true;
                    }
                    else if ((long)BJMainGame_Control.MyMoney - (BJMainGame_Control.BetMoney + BJMainGame_Control.SelectCoin) < 0)
                    {
                        Message_Control.OpenMessage   = true;
                        Message_Control.MessageStatus = Message_Control.MessageStatu.NoBetMoney;
                    }
                }
            }
            #endregion

            //關閉ENDWINDOW
            if (ButtonList_Control == ButtonList.GameEnd)
            {
                BJEndWindow_Control.EndWindow_Bool = false;
                StateShow_Control.Backgrond_Bool   = true;
                BJMainGame_Control.TableState[BJMainGame_Control.TableID].m_enumState = ENUM_BLACKJACK_TABLE_STATE.GameOver;
            }

            //Help
            if (ButtonList_Control == ButtonList.BJGameHelp)
            {
                if (BJHelp.BJHelpOpen_Bool)
                {
                    BJHelp.BJHelpOpen_Bool = false;
                }
                else
                {
                    BJHelp.BJHelpOpen_Bool = true;
                }

                BJHistory_Control.HistoryOpen_Bool = false;
                BJHelp.BarOpen_Bool = false;
            }

            //Help
            if (ButtonList_Control == ButtonList.BJHelpNext)
            {
                if (BJHelp.BJHelpPageNumber < 8)
                {
                    BJHelp.BJHelpPageNumber++;
                }
                else
                {
                    BJHelp.BJHelpPageNumber = 1;
                }
            }

            //Help
            if (ButtonList_Control == ButtonList.BJHelpBack)
            {
                if (BJHelp.BJHelpPageNumber > 1)
                {
                    BJHelp.BJHelpPageNumber--;
                }
                else
                {
                    BJHelp.BJHelpPageNumber = 8;
                }
            }
            //Help
            if (ButtonList_Control == ButtonList.BJHelpClose)
            {
                BJHelp.BJHelpOpen_Bool = false;
            }

            if (ButtonList_Control == ButtonList.InformationBoxOpen)
            {
                if (BJHelp.BarOpen_Bool)
                {
                    BJHelp.BarOpen_Bool = false;
                }
                else
                {
                    BJHelp.BarOpen_Bool = true;
                }

                BJHelp.BJHelpOpen_Bool             = false;
                BJHistory_Control.HistoryOpen_Bool = false;
            }

            if (ButtonList_Control == ButtonList.GameOut)
            {
                GameConnet.CloseGameConnet();
            }
        }
    }
示例#4
0
 void Close_OnClick()
 {
     GameConnet.CloseGameConnet();
 }
示例#5
0
 void ClickBackButton()
 {
     GameConnet.CloseGameConnet();
 }