The following instructions describe how to update the 3D-Tiles schema to support updates the the specification.
- Download latest schema from 3D Tiles github and place files in
SchemaGen\Generate\3DTileSchema. - Update the references in
SchemaGen\Generate.csprojunder the3DTileSchemafolder to include any new schema files or remove any old ones. Also ensure that all schema files have "Copy to Output Directory=Copy if newer" in the properties window otherwise you will get an exception hen running - Build and run SchemaGen\Generate.sln which will replace Assets\Unity3DTiles\TilesetSchema.cs
- Manually edit TilesetSchema.cs to build under .net 3.5 and to fix name errors such as:
-
Properties2 - delete and use Dictionary<string,object> instead
-
Rename/Refactor the class
Tileand all references toTileContent(be careful not to change other references in the project outside of TilesetSchema.cs) -
Rename/Refactor the class
Tile2becomesTile -
Rename/Refactor the class
Tile2RefinetoTileRefine -
Remove {get;set;} for any property with a default value
-
Find and replace
System.ArraywithList. Addusing System.Collections.Generic; -
Made Tile.Refine nullable (i.e.
public TileRefinetopublic TileRefine?) -
Edited TileContent.Uri section to support loading older tilesets that used "url"
/// <summary>A uri that points to the tile's content. When the uri is relative, it is relative to the referring tileset JSON file.</summary> [Newtonsoft.Json.JsonProperty("uri", NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Uri { get; set; } /// <summary> /// Property to support legacy format that used url instead of uri /// </summary> [Newtonsoft.Json.JsonProperty("url", NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public string Url { get; set; } /// <summary> /// Helper method to get uri or uri parameter for backwards compatability /// </summary> /// <returns></returns> public string GetUri() { if(Uri!= null) { return Uri; } return Url; } ```
-