public void Clear() { Log.Debug("Player Clear name={0}", name); if (stateController != null) { GameFrameworkEntry.GetModule <IFsmManager>().DestroyFsm(stateController.fsm); stateController = null; } if (headUI != null) { headUI.Reset(); headUI = null; } id.Dispose(); pos.Dispose(); clubId.Dispose(); if (this is PlayerOther) { RoomManager.Instance.rData.roomPlayers.Remove(this as PlayerOther); } ClearCards(); }
public void InitData() { state = EPlayerState.None; stateController = new PlayerStateController(); //初始化玩家状态机 stateController.Init(this, GameFrameworkEntry.GetModule <IFsmManager>(), new PlayerStateInit(), new PlayerStateEnterRoom(), new PlayerStateSeatPre(), new PlayerStateSeat(), new PlayerStateGameReady(), new PlayerStateStart(), new PlayerStateDeal(), new PlayerStatePlaying(), new PlayerStateBanker(), new PlayerStateBet(), new PlayerStateEnd(), new PlayerStateCardStyle(), new PlayerStateSettle() ); stateController.Start <PlayerStateInit>(); }