Magically import images and more into Gamecraft as blocks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1KB

  1. using Unity.Mathematics;
  2. using GamecraftModdingAPI.Blocks;
  3. namespace Pixi.Common
  4. {
  5. public struct ProcessedVoxelObjectNotation
  6. {
  7. public BlockIDs block;
  8. public BlockColor color;
  9. public bool blueprint;
  10. public float3 position;
  11. public float3 rotation;
  12. public float3 scale;
  13. public string metadata;
  14. internal BlockJsonInfo VoxelObjectNotation()
  15. {
  16. return new BlockJsonInfo
  17. {
  18. name = block == BlockIDs.Invalid ? metadata.Split(' ')[0] : block.ToString(),
  19. color = ColorSpaceUtility.UnquantizeToArray(color),
  20. position = ConversionUtility.Float3ToFloatArray(position),
  21. rotation = ConversionUtility.Float3ToFloatArray(rotation),
  22. scale = ConversionUtility.Float3ToFloatArray(scale),
  23. };
  24. }
  25. public override string ToString()
  26. {
  27. return $"ProcessedVoxelObjectNotation {{ block:{block}, color:{color.Color}-{color.Darkness}, blueprint:{blueprint}, position:{position}, rotation:{rotation}, scale:{scale}}} ({metadata})";
  28. }
  29. }
  30. }