Esempio n. 1
0
 public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
 {
     // For all chunks where trans has changed since start of simulation
     // Copy trans to currentTrans
     if (ChangeVersionUtility.DidChange(chunk.GetComponentVersion(rotationType), simStartComponentVersion))
     {
         // Transform was interpolated by the rendering system
         var curRot = chunk.GetNativeArray(curRotationType);
         var rot    = chunk.GetNativeArray(rotationType);
         // FIXME: use a memcopy since size and layout must be identical
         for (int ent = 0; ent < curRot.Length; ++ent)
         {
             curRot[ent] = new CurrentSimulatedRotation {
                 Value = rot[ent].Value
             };
         }
     }
 }
Esempio n. 2
0
            public void Execute(ArchetypeChunk chunk, int chunkIndex, int firstEntityIndex)
            {
                var curRot = chunk.GetNativeArray(curRotationType);
                var rot    = chunk.GetNativeArray(rotationType);
                var entity = chunk.GetNativeArray(entityType);

                // FIXME: use a memcopy since size and layout must be identical
                for (int ent = 0; ent < curRot.Length; ++ent)
                {
                    var cr = rot[ent];
                    curRot[ent] = new CurrentSimulatedRotation {
                        Value = cr.Value
                    };
                    commandBuffer.AddComponent(chunkIndex, entity[ent], new PreviousSimulatedRotation {
                        Value = cr.Value
                    });
                }
            }