public FBWorld(FBGame game) { fbGame = game; m_world.onObstacleCollided = _onObstacleCollided; m_world.onParticleCollided = _onParticleCollided; m_world.addObstacle(m_arena); }
public void deleteFBGame() { RoomSession.inst.logout(); fbGame.destory(); fbGame = null; }
public FBGame newFBGame() { fbGame = new FBGame(); LogicEvent.fire("onFBGameNewed"); return(fbGame); }
void onFBGameNewed(FBGame game) { RealTimeRAProcessCenter.instance.GetType().GetField("fbGame", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.Instance).SetValue(RealTimeRAProcessCenter.instance, game); #if FRAME_RECORDING FrameRecording.instance.GetType().GetField("fbGame", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.Instance).SetValue(FrameRecording.instance, game); #endif }
void loadServerMessages() { if (fbGame != null) { fbGame.destory(); fbGame = null; } //byte[] data = ResourcesManager.instance.getFileData(serverMessagesName); byte[] data = ConfigResourceLoader.inst.getFileData(serverMessagesName); BytesStream stream = new BytesStream(data); serverMessages.Clear(); var tsn = new TableStartNotify(); tsn.unMarshal(stream); //tsn.unserialize(stream); fbGame = new FBGame(); LogicEvent.fire("onFBGameNewed", fbGame); fbGame.setupFBGame(tsn.tableId, tsn.mapId); fbGame.createCoach(string.Format("{0}/Resources/Config/Behaviac", UnityEngine.Application.dataPath)); //创建玩家 var playerCount = tsn.allPlayerInfos.Count; for (int i = 0; i < playerCount; ++i) { var player = tsn.allPlayerInfos[i]; fbGame.createPlayer(0, player.frameId, player.roleId, player.team, "给我来段FreeStyle", false, player.ai); } //处理输入消息 var fm = new FramesMsg(); fm.unMarshal(stream); //fm.unserialize(stream); for (int i = 0; i < fm.allFrameMessages.Count; ++i) { var msg = fm.allFrameMessages[i]; pushServerMessage(msg); } fbGame.changeState(GameState.Ready); }
public GoalState(FBGame game) : base(game) { }
public GameEnterState(FBGame game) : base(game) { }
public GameReadyState(FBGame game) : base(game) { }
public ReplayState(FBGame game) : base(game) { }
public GameOverState(FBGame game) : base(game) { }
public GamingState(FBGame game) : base(game) { LogicEvent.add("onPauseTimer", this, "onPauseTimer"); LogicEvent.add("onContinueTimer", this, "onContinueTimer"); }
public GameStateBase(FBGame game) { this.game = game; }