Example #1
0
 public FBWorld(FBGame game)
 {
     fbGame = game;
     m_world.onObstacleCollided = _onObstacleCollided;
     m_world.onParticleCollided = _onParticleCollided;
     m_world.addObstacle(m_arena);
 }
Example #2
0
    public void deleteFBGame()
    {
        RoomSession.inst.logout();

        fbGame.destory();

        fbGame = null;
    }
Example #3
0
    public FBGame newFBGame()
    {
        fbGame = new FBGame();

        LogicEvent.fire("onFBGameNewed");

        return(fbGame);
    }
Example #4
0
    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
    }
Example #5
0
    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);
    }
Example #6
0
 public GoalState(FBGame game) : base(game)
 {
 }
Example #7
0
 public GameEnterState(FBGame game) : base(game)
 {
 }
Example #8
0
 public GameReadyState(FBGame game) : base(game)
 {
 }
Example #9
0
 public ReplayState(FBGame game) : base(game)
 {
 }
Example #10
0
 public GameOverState(FBGame game) : base(game)
 {
 }
Example #11
0
 public GamingState(FBGame game) : base(game)
 {
     LogicEvent.add("onPauseTimer", this, "onPauseTimer");
     LogicEvent.add("onContinueTimer", this, "onContinueTimer");
 }
Example #12
0
 public GameStateBase(FBGame game)
 {
     this.game = game;
 }