public void Init(CGame_BlackJack bjGame, Transform uiParent) { m_BjGameBase = bjGame; m_iRoomID = 0; m_nRoomLevel = NoSit; m_eRoomState = BlackRoomState_Enum.BlackRoomState_Init; m_fCountTime = 0.0f; m_iTurnAskDoubleSign = NoSit; m_iCurPokerPos = 0; m_Dealer = new Black_Dealer(bjGame, uiParent); m_PlayerList = new Black_Player[PlayerNum]; for (byte i = 0; i < m_PlayerList.Length; i++) { m_PlayerList[i] = new Black_Player(i, bjGame, uiParent); } GameObject gameObj = GameObject.Find("Game_Model/DealerCtrl"); if (gameObj != null) { m_DealerAnimCtrl = gameObj.AddComponent <Black_DealerAnimCtrl>(); m_DealerAnimCtrl.m_BjGameBase = bjGame; } }
public void OnStateChange(BlackRoomState_Enum state) { if (m_eRoomState == state) { return; } DebugLog.Log(string.Format("room state change: ({0}->{1})", m_eRoomState, state)); //OnQuitSate switch (m_eRoomState) { case BlackRoomState_Enum.BlackRoomState_ChipIn: { if (m_BjGameBase.m_nLocalPlayerSit < RoomInfo.PlayerNum) { CustomAudioDataManager.GetInstance().PlayAudio(1006); } foreach (Black_Player player in m_PlayerList) { player.OnLocalPlayerSit(false, m_BjGameBase.m_nLocalPlayerSit); } } break; default: break; } m_eRoomState = state; //OnEnterState switch (m_eRoomState) { case BlackRoomState_Enum.BlackRoomState_WaitBoss: { foreach (Black_Player player in m_PlayerList) { player.OnLocalPlayerSit(true, m_BjGameBase.m_nLocalPlayerSit); } } break; case BlackRoomState_Enum.BlackRoomState_ChipIn: { m_fCountTime = m_fStateTime = BlackJack_Data.GetInstance().m_fChipInTime; foreach (Black_Player player in m_PlayerList) { player.OnLocalPlayerSit(true, m_BjGameBase.m_nLocalPlayerSit, true); } } break; case BlackRoomState_Enum.BlackRoomState_DealCards: { m_fCountTime = m_fStateTime = BlackJack_Data.GetInstance().m_fAskNeedTime; } break; case BlackRoomState_Enum.BlackRoomState_BuySafe: { m_fCountTime = m_fStateTime = BlackJack_Data.GetInstance().m_fBuySafeTime; } break; case BlackRoomState_Enum.BlackRoomState_End: { OnEnd(); } break; default: { m_fCountTime = 0.0f; } break; } }