Exemple #1
0
    public void Deserialize(ref NetworkReader reader, IEntityReferenceSerializer refSerializer, int tick)
    {
        m_lastServerState.Deserialize(ref reader, refSerializer, tick);

#if UNITY_EDITOR
        if (ReplicatedEntityCollection.SampleHistory)
        {
            var index = serverStateTicks.GetIndex((uint)tick);
            if (index == -1)
            {
                index = serverStateTicks.Register((uint)tick);
            }
            serverStates[index] = m_lastServerState;
        }
#endif
    }
        public override System.Object GetPredicted(int tick)
        {
            int index = predictionTicks.GetIndex((uint)tick);

            if (index == -1)
            {
                return(null);
            }
            return(predictions[index]);
        }
        public override System.Object GetState(int tick)
        {
            int index = stateTicks.GetIndex((uint)tick);

            if (index == -1)
            {
                return(null);
            }
            return(states[index]);
        }