Пример #1
0
 public GenericData(int size)
 {
     states          = new T[size];
     stateTicks      = new SparseTickBuffer(size);
     predictions     = new T[size];
     predictionTicks = new SparseTickBuffer(size);
 }
Пример #2
0
    public NetworkPredictedDataHandler(EntityManager entityManager, Entity entity)
    {
        this.entityManager = entityManager;
        this.entity        = entity;

#if UNITY_EDITOR
        serverStateTicks = new SparseTickBuffer(ReplicatedEntityCollection.HistorySize);
        serverStates     = new T[ReplicatedEntityCollection.HistorySize];

//        predictedStateTicks = new SparseTickBuffer(ReplicatedEntityCollection.HistorySize);
        predictedStates = new T[ReplicatedEntityCollection.HistorySize * ReplicatedEntityCollection.PredictionSize];
#endif
    }
Пример #3
0
    public PredictedComponentSerializer(EntityManager entityManager, Entity entity,
                                        IEntityReferenceSerializer refSerializer)
    {
        context.entityManager = entityManager;
        context.entity        = entity;
        context.refSerializer = refSerializer;

    #if UNITY_EDITOR
        serverStateTicks = new SparseTickBuffer(ReplicatedEntityCollection.HistorySize);
        serverStates     = new T[ReplicatedEntityCollection.HistorySize];

        //        predictedStateTicks = new SparseTickBuffer(ReplicatedEntityCollection.HistorySize);
        predictedStates = new T[ReplicatedEntityCollection.HistorySize * ReplicatedEntityCollection.PredictionSize];
    #endif
    }