Merge pull request #681 from hiroj/add_enumSerialization_asstring

add enumSerialization as string
This commit is contained in:
ousttrue
2021-01-20 17:31:02 +09:00
committed by GitHub

View File

@@ -46,6 +46,9 @@ namespace UniGLTF
// (ProjectionType)Enum.Parse(typeof(ProjectionType), kv.Value.GetString(), true)
return $"({m_type.Name})Enum.Parse(typeof({m_type.Name}), {argName}.GetString(), true)";
case EnumSerializationType.AsString:
return $"({m_type.Name})Enum.Parse(typeof({m_type.Name}), {argName}.GetString(), false)";
default:
throw new NotImplementedException();
}
@@ -71,6 +74,9 @@ namespace UniGLTF
case EnumSerializationType.AsLowerString:
return $"f.Value({argName}.ToString().ToLower())";
case EnumSerializationType.AsString:
return $"f.Value({argName}.ToString())";
default:
throw new NotImplementedException();
}