Пример #1
0
    protected override void OnCreate()
    {
        m_GhostUpdateSystemGroup = World.GetOrCreateSystem <GhostUpdateSystemGroup>();
        m_ghostEntityMap         = m_GhostUpdateSystemGroup.GhostEntityMap;
#if UNITY_EDITOR || DEVELOPMENT_BUILD
        m_ghostMinMaxSnapshotTick = m_GhostUpdateSystemGroup.GhostSnapshotTickMinMax;
#endif
        m_ClientSimulationSystemGroup = World.GetOrCreateSystem <ClientSimulationSystemGroup>();
        m_GhostPredictionSystemGroup  = World.GetOrCreateSystem <GhostPredictionSystemGroup>();
        m_interpolatedQuery           = GetEntityQuery(new EntityQueryDesc
        {
            All = new [] {
                ComponentType.ReadWrite <LagCompensationTestPlayerSnapshotData>(),
                ComponentType.ReadOnly <GhostComponent>(),
                ComponentType.ReadWrite <LagCompensationTestPlayer>(),
                ComponentType.ReadWrite <Rotation>(),
                ComponentType.ReadWrite <Translation>(),
            },
            None = new [] { ComponentType.ReadWrite <PredictedGhostComponent>() }
        });
        m_predictedQuery = GetEntityQuery(new EntityQueryDesc
        {
            All = new [] {
                ComponentType.ReadOnly <LagCompensationTestPlayerSnapshotData>(),
                ComponentType.ReadOnly <GhostComponent>(),
                ComponentType.ReadOnly <PredictedGhostComponent>(),
                ComponentType.ReadWrite <LagCompensationTestPlayer>(),
                ComponentType.ReadWrite <Rotation>(),
                ComponentType.ReadWrite <Translation>(),
            }
        });
        RequireForUpdate(GetEntityQuery(ComponentType.ReadWrite <LagCompensationTestPlayerSnapshotData>(),
                                        ComponentType.ReadOnly <GhostComponent>()));
    }
 protected override void OnCreate()
 {
     m_GhostUpdateSystemGroup      = World.GetOrCreateSystem <GhostUpdateSystemGroup>();
     m_ClientSimulationSystemGroup = World.GetOrCreateSystem <ClientSimulationSystemGroup>();
     m_GhostPredictionSystemGroup  = World.GetOrCreateSystem <GhostPredictionSystemGroup>();
     m_interpolatedQuery           = GetEntityQuery(new EntityQueryDesc
     {
         All = new [] {
             ComponentType.ReadWrite <ExtraBlockSnapshotData>(),
             ComponentType.ReadOnly <GhostComponent>(),
             ComponentType.ReadWrite <Rotation>(),
             ComponentType.ReadWrite <Translation>(),
         },
         None = new [] { ComponentType.ReadWrite <PredictedGhostComponent>() }
     });
     m_predictedQuery = GetEntityQuery(new EntityQueryDesc
     {
         All = new [] {
             ComponentType.ReadOnly <ExtraBlockSnapshotData>(),
             ComponentType.ReadOnly <GhostComponent>(),
             ComponentType.ReadOnly <PredictedGhostComponent>(),
             ComponentType.ReadWrite <Rotation>(),
             ComponentType.ReadWrite <Translation>(),
         }
     });
     RequireForUpdate(GetEntityQuery(ComponentType.ReadWrite <ExtraBlockSnapshotData>(),
                                     ComponentType.ReadOnly <GhostComponent>()));
 }
Пример #3
0
 protected override void OnCreate()
 {
     m_GhostUpdateSystemGroup      = World.GetOrCreateSystem <GhostUpdateSystemGroup>();
     m_ClientSimulationSystemGroup = World.GetOrCreateSystem <ClientSimulationSystemGroup>();
     m_GhostPredictionSystemGroup  = World.GetOrCreateSystem <GhostPredictionSystemGroup>();
     m_interpolatedQuery           = GetEntityQuery(new EntityQueryDesc
     {
         All = new [] {
             ComponentType.ReadWrite <CharacterSnapshotData>(),
             ComponentType.ReadOnly <GhostComponent>(),
             ComponentType.ReadWrite <Attack>(),
             ComponentType.ReadWrite <Damage>(),
             ComponentType.ReadWrite <MovableCharacterComponent>(),
             ComponentType.ReadWrite <PlayerData>(),
             ComponentType.ReadWrite <PrefabCreator>(),
             ComponentType.ReadWrite <Translation>(),
         },
         None = new [] { ComponentType.ReadWrite <PredictedGhostComponent>() }
     });
     m_predictedQuery = GetEntityQuery(new EntityQueryDesc
     {
         All = new [] {
             ComponentType.ReadOnly <CharacterSnapshotData>(),
             ComponentType.ReadOnly <GhostComponent>(),
             ComponentType.ReadOnly <PredictedGhostComponent>(),
         }
     });
     RequireForUpdate(GetEntityQuery(ComponentType.ReadWrite <CharacterSnapshotData>(),
                                     ComponentType.ReadOnly <GhostComponent>()));
 }
Пример #4
0
        protected override void OnCreate()
        {
            RequireSingletonForUpdate <EnableNetFPS>();

            m_GhostUpdateSystemGroup = World.GetOrCreateSystem <GhostUpdateSystemGroup>();
            m_NetworkTime            = World.GetOrCreateSystem <NetworkTimeSystem>();
            m_Queue = new NativeQueue <FireRpc>(Allocator.Persistent);
        }
    protected override void OnCreate()
    {
        m_GhostUpdateSystemGroup = World.GetOrCreateSystem <GhostUpdateSystemGroup>();
        m_ghostEntityMap         = m_GhostUpdateSystemGroup.GhostEntityMap;
#if UNITY_EDITOR || DEVELOPMENT_BUILD
        m_ghostMinMaxSnapshotTick = m_GhostUpdateSystemGroup.GhostSnapshotTickMinMax;
#endif
        m_ClientSimulationSystemGroup = World.GetOrCreateSystem <ClientSimulationSystemGroup>();
        m_GhostPredictionSystemGroup  = World.GetOrCreateSystem <GhostPredictionSystemGroup>();
        m_interpolatedQuery           = GetEntityQuery(new EntityQueryDesc
        {
            All = new [] {
                ComponentType.ReadWrite <Char_TerraformerSnapshotData>(),
                ComponentType.ReadOnly <GhostComponent>(),
                ComponentType.ReadWrite <Character.InterpolatedData>(),
                ComponentType.ReadWrite <Character.ReplicatedData>(),
                ComponentType.ReadWrite <CharacterControllerGroundSupportData>(),
                ComponentType.ReadWrite <CharacterControllerMoveResult>(),
                ComponentType.ReadWrite <CharacterControllerVelocity>(),
                ComponentType.ReadWrite <HealthStateData>(),
                ComponentType.ReadWrite <Inventory.State>(),
                ComponentType.ReadWrite <Player.OwnerPlayerId>(),
                ComponentType.ReadWrite <PlayerControlled.State>(),
                ComponentType.ReadOnly <LinkedEntityGroup>(),
            },
            None = new [] { ComponentType.ReadWrite <PredictedGhostComponent>() }
        });
        m_predictedQuery = GetEntityQuery(new EntityQueryDesc
        {
            All = new [] {
                ComponentType.ReadOnly <Char_TerraformerSnapshotData>(),
                ComponentType.ReadOnly <GhostComponent>(),
                ComponentType.ReadOnly <PredictedGhostComponent>(),
                ComponentType.ReadWrite <Character.PredictedData>(),
                ComponentType.ReadWrite <Character.ReplicatedData>(),
                ComponentType.ReadWrite <CharacterControllerGroundSupportData>(),
                ComponentType.ReadWrite <CharacterControllerMoveResult>(),
                ComponentType.ReadWrite <CharacterControllerVelocity>(),
                ComponentType.ReadWrite <HealthStateData>(),
                ComponentType.ReadWrite <Inventory.State>(),
                ComponentType.ReadWrite <Player.OwnerPlayerId>(),
                ComponentType.ReadWrite <PlayerControlled.State>(),
                ComponentType.ReadOnly <LinkedEntityGroup>(),
            }
        });
        RequireForUpdate(GetEntityQuery(ComponentType.ReadWrite <Char_TerraformerSnapshotData>(),
                                        ComponentType.ReadOnly <GhostComponent>()));
    }
    protected override void OnCreate()
    {
        m_GhostUpdateSystemGroup = World.GetOrCreateSystem <GhostUpdateSystemGroup>();
        m_ghostEntityMap         = m_GhostUpdateSystemGroup.GhostEntityMap;
#if UNITY_EDITOR || DEVELOPMENT_BUILD
        m_ghostMinMaxSnapshotTick = m_GhostUpdateSystemGroup.GhostSnapshotTickMinMax;
#endif
        m_ClientSimulationSystemGroup = World.GetOrCreateSystem <ClientSimulationSystemGroup>();
        m_GhostPredictionSystemGroup  = World.GetOrCreateSystem <GhostPredictionSystemGroup>();
        m_interpolatedQuery           = GetEntityQuery(new EntityQueryDesc
        {
            All = new [] {
                ComponentType.ReadWrite <__GHOST_NAME__SnapshotData>(),
                ComponentType.ReadOnly <GhostComponent>(),
                #region __GHOST_INTERPOLATED_COMPONENT_TYPE__
                ComponentType.ReadWrite <__GHOST_COMPONENT_TYPE__>(),
                #endregion
                #region __GHOST_INTERPOLATED_READ_ONLY_COMPONENT_TYPE__
                ComponentType.ReadOnly <__GHOST_COMPONENT_TYPE__>(),
                #endregion
            },
            None = new [] { ComponentType.ReadWrite <PredictedGhostComponent>() }
        });
        m_predictedQuery = GetEntityQuery(new EntityQueryDesc
        {
            All = new [] {
                ComponentType.ReadOnly <__GHOST_NAME__SnapshotData>(),
                ComponentType.ReadOnly <GhostComponent>(),
                ComponentType.ReadOnly <PredictedGhostComponent>(),
                #region __GHOST_PREDICTED_COMPONENT_TYPE__
                ComponentType.ReadWrite <__GHOST_COMPONENT_TYPE__>(),
                #endregion
                #region __GHOST_PREDICTED_READ_ONLY_COMPONENT_TYPE__
                ComponentType.ReadOnly <__GHOST_COMPONENT_TYPE__>(),
                #endregion
            }
        });
        RequireForUpdate(GetEntityQuery(ComponentType.ReadWrite <__GHOST_NAME__SnapshotData>(),
                                        ComponentType.ReadOnly <GhostComponent>()));
    }