Ejemplo n.º 1
0
        protected override void OnCreate()
        {
            FSLog.Info("PreviewClientSimulationSystemGroup OnCreate");
            Application.targetFrameRate     = 60;
            UnityEngine.Time.fixedDeltaTime = gameTime.TickInterval;
            ConfigVar.Init();
            ItemCreateUtilities.Init();
            ClientCharacterUtilities.Init();
            IconUtilities.Init();
            GameWorld.Active = new GameWorld();
            EntityManager.CreateEntity(typeof(Server));
            SetSingleton(new Server());

            inputSystem = World.GetOrCreateSystem <InputSystem>();
            m_systemsToUpdate.Add(inputSystem);

            initSystemGroup = World.GetOrCreateSystem <InitSystemGroup>();
            m_systemsToUpdate.Add(initSystemGroup);

            spawnCharacterSystem = World.GetOrCreateSystem <SpawnCharactersSystem>();
            m_systemsToUpdate.Add(spawnCharacterSystem);

            spawnSystemGroup = World.GetOrCreateSystem <SpawnSystemGroup>();
            m_systemsToUpdate.Add(spawnSystemGroup);

            updateReplicatedOwnerFlag = World.GetOrCreateSystem <UpdateReplicatedOwnerFlag>();
            m_systemsToUpdate.Add(updateReplicatedOwnerFlag);

            predictUpdateSystem = World.GetOrCreateSystem <PredictUpdateSystemGroup>();
            m_systemsToUpdate.Add(predictUpdateSystem);

            serverSystemGroup = World.GetOrCreateSystem <ServerSystemGroup>();
            m_systemsToUpdate.Add(serverSystemGroup);

            predictPresentationSystemGroup = World.GetOrCreateSystem <PredictPresentationSystemGroup>();
            m_systemsToUpdate.Add(predictPresentationSystemGroup);

            despawnSystemGroup = World.GetOrCreateSystem <DespawnSystemGroup>();
            m_systemsToUpdate.Add(despawnSystemGroup);

            addItemComponentSystem = World.GetOrCreateSystem <AddItemComponentSystem>();
            m_systemsToUpdate.Add(addItemComponentSystem);

            addDespawnServerSystem = World.GetOrCreateSystem <AddDespawnServerSystem>();
            m_systemsToUpdate.Add(addDespawnServerSystem);


            updateReplicatedOwnerFlag.SetLocalPlayerId(0);
        }
        protected override void OnCreate()
        {
            FSLog.Info("KitchenClientSimulationSystemGroup OnCreate");

            ConfigVar.Init();
            GameWorld.Active = new GameWorld();
            ItemCreateUtilities.Init();
            ClientCharacterUtilities.Init();
            MenuUtilities.Init();
            IconUtilities.Init();
            Application.targetFrameRate     = 60;
            UnityEngine.Time.fixedDeltaTime = GameTick.DefaultGameTick.TickInterval;

            worldSceneEntitiesSystem = World.GetOrCreateSystem <WorldSceneEntitiesSystem>();
            m_systemsToUpdate.Add(worldSceneEntitiesSystem);

            networkSystem = World.GetOrCreateSystem <NetworkClientSystem>();
            m_systemsToUpdate.Add(networkSystem);

            handleTimeSystem = World.GetOrCreateSystem <HandleTimeSystem>();
            m_systemsToUpdate.Add(handleTimeSystem);

            setRenderTimeSystem = World.GetOrCreateSystem <SetRenderTimeSystem>();
            m_systemsToUpdate.Add(setRenderTimeSystem);

            replicateEntitySystemGroup = World.GetOrCreateSystem <ReplicateEntitySystemGroup>();
            m_systemsToUpdate.Add(replicateEntitySystemGroup);


            setPredictTimeSystem = World.GetOrCreateSystem <SetPredictTimeSystem>();
            m_systemsToUpdate.Add(setPredictTimeSystem);

            predictSystem = World.GetOrCreateSystem <PredictSystem>();
            m_systemsToUpdate.Add(predictSystem);

            itemClientSystemGroup = World.GetOrCreateSystem <ItemClientSystemGroup>();
            m_systemsToUpdate.Add(itemClientSystemGroup);


            predictPresentationSystemGroup = World.GetOrCreateSystem <PredictPresentationSystemGroup>();
            m_systemsToUpdate.Add(predictPresentationSystemGroup);

            despawnSystemGroup = World.GetOrCreateSystem <DespawnSystemGroup>();
            m_systemsToUpdate.Add(despawnSystemGroup);
        }