mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-07-04 10:14:25 +00:00
Core(Box.cs) - Update class to be json serialisable
This commit is contained in:
@@ -1,13 +1,24 @@
|
||||
using System.Numerics;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PckStudio.Core
|
||||
{
|
||||
public class Box(Vector3 position, Vector3 size, Vector2 uv, float inflate, bool mirror)
|
||||
{
|
||||
|
||||
[JsonProperty("pos", Required = Required.Always)]
|
||||
public Vector3 Position { get; } = position;
|
||||
|
||||
[JsonProperty("size", Required = Required.Always)]
|
||||
public Vector3 Size { get; } = size;
|
||||
|
||||
[JsonProperty("uv", Required = Required.Always)]
|
||||
public Vector2 Uv { get; } = uv;
|
||||
|
||||
[JsonProperty("mirror", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public float Inflate { get; } = inflate;
|
||||
|
||||
[JsonProperty("inflate", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool Mirror { get; } = mirror;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,24 +25,6 @@ namespace PckStudio.Core.Json
|
||||
public Vector3 Rotation { get; set; } = Vector3.Zero;
|
||||
|
||||
[JsonProperty("boxes")]
|
||||
public ModelDefaultBox[] Boxes { get; set; }
|
||||
}
|
||||
|
||||
public class ModelDefaultBox
|
||||
{
|
||||
[JsonProperty("pos")]
|
||||
public Vector3 Position { get; set; }
|
||||
|
||||
[JsonProperty("size")]
|
||||
public Vector3 Size { get; set; }
|
||||
|
||||
[JsonProperty("uv")]
|
||||
public Vector2 Uv { get; set; }
|
||||
|
||||
[JsonProperty("mirror")]
|
||||
public bool Mirror { get; set; } = false;
|
||||
|
||||
[JsonProperty("inflate")]
|
||||
public float Inflate { get; set; } = 0f;
|
||||
public Box[] Boxes { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user