mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-18 03:24:15 -04:00
Add option to export Live2D Cubism models
This commit is contained in:
28
AssetStudioUtility/CubismLive2DExtractor/MyJsonConverter2.cs
Normal file
28
AssetStudioUtility/CubismLive2DExtractor/MyJsonConverter2.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CubismLive2DExtractor
|
||||
{
|
||||
public class MyJsonConverter2 : JsonConverter
|
||||
{
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return objectType == typeof(float);
|
||||
}
|
||||
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
Convert(writer, (float)value);
|
||||
}
|
||||
|
||||
private void Convert(JsonWriter writer, float value)
|
||||
{
|
||||
writer.WriteRawValue(value.ToString("0.###", System.Globalization.CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user