StructureData.cs 966 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using UnityEngine;
  2. using UnityEngine.Assertions;
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. #if UNITY_EDITOR
  7. namespace VoxelImporter
  8. {
  9. public class StructureData
  10. {
  11. public struct Voxel
  12. {
  13. public List<Index> indices;
  14. }
  15. public struct Index
  16. {
  17. public Index(int vertexIndex, VoxelBase.VoxelVertexIndex voxelPosition)
  18. {
  19. this.vertexIndex = vertexIndex;
  20. this.voxelPosition = voxelPosition;
  21. }
  22. public int vertexIndex;
  23. public VoxelBase.VoxelVertexIndex voxelPosition;
  24. }
  25. public StructureData(VoxelData voxelData)
  26. {
  27. voxels = new Voxel[voxelData.voxels.Length];
  28. for (int i = 0; i < voxels.Length; i++)
  29. {
  30. voxels[i].indices = new List<Index>();
  31. }
  32. }
  33. public Voxel[] voxels;
  34. }
  35. }
  36. #endif