mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-03 11:46:02 -05:00
* MeshUtility を UniGLTF 下に移動 * Assets/VRM10 を追加 * JsonSchemaからのコード生成 UniGLTF/Editor/Generator を追加
32 lines
839 B
C#
32 lines
839 B
C#
namespace UniGLTF.JsonSchema.Schemas
|
|
{
|
|
public class StringJsonSchema : JsonSchemaBase
|
|
{
|
|
public readonly string Pattern;
|
|
|
|
public StringJsonSchema(in JsonSchemaSource source) : base(source)
|
|
{
|
|
Pattern = source.pattern;
|
|
}
|
|
|
|
public override string ValueType => "string";
|
|
|
|
public override bool IsInline => true;
|
|
|
|
public override string CreateSerializationCondition(string argName)
|
|
{
|
|
return $"!string.IsNullOrEmpty({argName})";
|
|
}
|
|
|
|
public override string GenerateDeserializerCall(string callName, string argName)
|
|
{
|
|
return $"{argName}.GetString()";
|
|
}
|
|
|
|
public override string GenerateSerializerCall(string callName, string argName)
|
|
{
|
|
return $"f.Value({argName})";
|
|
}
|
|
}
|
|
}
|