Skip to content

Commit

Permalink
EnumSerializationType 指定を除去(Reflection用の印なので無くてよい)
Browse files Browse the repository at this point in the history
  • Loading branch information
ousttrue committed Apr 19, 2021
1 parent 60e4844 commit 359ae9c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 42 deletions.
25 changes: 1 addition & 24 deletions Assets/UniGLTF/Editor/Generator/FormatWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,6 @@ class FormatWriter
m_prefix = prefix;
}

// static string UpperCamelCase(string src)
// {
// if(string.IsNullOrEmpty(src))
// {
// return "";
// }
// return src.Substring(0, 1).ToUpper() + src.Substring(1);
// }

// string ClassName(string src)
// {
// if(string.IsNullOrEmpty(src))
// {
// // root
// return m_prefix;
// }
// else{
// return String.Join("", src.Split("__").Select(x => UpperCamelCase(x)));
// }
// }

const string EnumStringAttr = "[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]";

static (string, string) PropType(JsonSchemaBase schema)
{
switch (schema.JsonSchemaType)
Expand All @@ -55,7 +32,7 @@ class FormatWriter
return (null, schema.ValueType);

case JsonSchemaType.EnumString:
return (EnumStringAttr, schema.ValueType);
return (null, schema.ValueType);
}

throw new NotImplementedException();
Expand Down
6 changes: 0 additions & 6 deletions Assets/VRM10/Runtime/Format/Constraints/Format.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,9 @@ public class PositionConstraint
public int? Source;

// The source node will be evaluated in this space.
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ObjectSpace SourceSpace;

// The destination node will be evaluated in this space.
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ObjectSpace DestinationSpace;

// Axes be constrained by this constraint, in X-Y-Z order.
Expand All @@ -57,11 +55,9 @@ public class RotationConstraint
public int? Source;

// The source node will be evaluated in this space.
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ObjectSpace SourceSpace;

// The destination node will be evaluated in this space.
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ObjectSpace DestinationSpace;

// Axes be constrained by this constraint, in X-Y-Z order.
Expand All @@ -86,11 +82,9 @@ public class AimConstraint
public int? Source;

// The source node will be evaluated in this space.
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ObjectSpace SourceSpace;

// The destination node will be evaluated in this space.
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ObjectSpace DestinationSpace;

// An axis which faces the direction of its source.
Expand Down
1 change: 0 additions & 1 deletion Assets/VRM10/Runtime/Format/MaterialsMToon/Format.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public class VRMC_materials_mtoon
public float? ParametricRimLiftFactor;

// Outline
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public OutlineWidthMode OutlineWidthMode;

public float? OutlineWidthFactor;
Expand Down
11 changes: 0 additions & 11 deletions Assets/VRM10/Runtime/Format/Vrm/Format.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public class Meta
public int? ThumbnailImage;

// A person who can perform with this avatars
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public AvatarPermissionType AvatarPermission;

// A flag that permits to use this avatar in excessively violent contents
Expand All @@ -75,21 +74,18 @@ public class Meta
public bool? AllowExcessivelySexualUsage;

// An option that permits to use this avatar in commercial products
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public CommercialUsageType CommercialUsage;

// A flag that permits to use this avatar in political or religious contents
public bool? AllowPoliticalOrReligiousUsage;

// An option that forces or abandons to display the credit of this avatar
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public CreditNotationType CreditNotation;

// A flag that permits to redistribute this avatar
public bool? AllowRedistribution;

// An option that controls the condition to modify this avatar
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ModificationType Modification;

// Describe the URL links of other license
Expand Down Expand Up @@ -291,7 +287,6 @@ public class MeshAnnotation
public int? Node;

// How the camera interprets the mesh.
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public FirstPersonType FirstPersonType;
}

Expand Down Expand Up @@ -322,7 +317,6 @@ public class LookAt
// The origin of LookAt. Position offset from the head bone
public float[] OffsetFromHeadBone;

[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public LookAtType LookAtType;

// Horizontal inward movement. The left eye moves right. The right eye moves left.
Expand Down Expand Up @@ -401,7 +395,6 @@ public class MaterialColorBind
// target material
public int? Material;

[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public MaterialColorType Type;

// target color
Expand Down Expand Up @@ -446,7 +439,6 @@ public class Expression
public string Name;

// Functions of Expression
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ExpressionPreset Preset;

// Specify a morph target
Expand All @@ -462,15 +454,12 @@ public class Expression
public bool? IsBinary;

// Override values of Blink expressions when this Expression is enabled
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ExpressionOverrideType OverrideBlink;

// Override values of LookAt expressions when this Expression is enabled
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ExpressionOverrideType OverrideLookAt;

// Override values of Mouth expressions when this Expression is enabled
[JsonSchema(EnumSerializationType = EnumSerializationType.AsString)]
public ExpressionOverrideType OverrideMouth;
}

Expand Down

0 comments on commit 359ae9c

Please sign in to comment.