예제 #1
0
 public ImportTask(List <GLTFBufferView> bufferViews, GLTFBuffer.ImportTask bufferTask) : base(bufferTask)
 {
     task = new Task(() => {
         Result = new ImportResult[bufferViews.Count];
         for (int i = 0; i < Result.Length; i++)
         {
             int byteOffset = bufferViews[i].byteOffset;
             int byteLength = bufferViews[i].byteLength;
             GLTFBuffer.ImportResult buffer = bufferTask.Result[bufferViews[i].buffer];
             ImportResult result            = new ImportResult();
             result.bytes = buffer.bytes.SubArray(byteOffset, byteLength);
             Result[i]    = result;
         }
     });
 }
예제 #2
0
 public ImportTask(List <GLTFBufferView> bufferViews, GLTFBuffer.ImportTask bufferTask) : base(bufferTask)
 {
     task = new Task(() => {
         Result = new ImportResult[bufferViews.Count];
         for (int i = 0; i < Result.Length; i++)
         {
             GLTFBuffer.ImportResult buffer = bufferTask.Result[bufferViews[i].buffer];
             ImportResult result            = new ImportResult();
             result.stream      = buffer.stream;
             result.byteOffset  = bufferViews[i].byteOffset;
             result.byteOffset += (int)buffer.startOffset;
             result.byteLength  = bufferViews[i].byteLength;
             result.byteStride  = bufferViews[i].byteStride;
             Result[i]          = result;
         }
     });
 }