Exemple #1
0
        private void SerializeWorldPosition(EntityManager EntityManager, Entity entity, uint mask, IOutBitStream protocolOutStream)
        {
            // Write component changes to output stream
            var componentData = EntityManager.GetComponentData <Translation>(entity);

            unityWriters.Write(componentData, mask, protocolOutStream);

            // Reset accumulated priority so the same component is not sent again next frame
            var syncData = EntityManager.GetComponentData <WorldPosition_Sync>(entity);

            syncData.accumulatedPriority = 0;

            syncData.lastSentData = componentData;

            syncData.hasBeenSerialized = true;
            syncData.resendMask       &= ~mask; // Clear serialized fields from resend mask
            EntityManager.SetComponentData(entity, syncData);
        }
Exemple #2
0
 private void SerializeWorldPosition(EntityManager EntityManager, Entity entity, uint mask, IOutBitStream protocolOutStream)
 {
     // Write component changes to output stream
     var componentData = EntityManager.GetComponentData<Translation>(entity);
     unityWriters.Write(componentData, mask, protocolOutStream);
 }