public override byte[] WriteGLTF() { var target = this._target; var gltfJson = new MyJson_Tree(); // var assetJson = new MyJson_Tree(); assetJson.SetInt("version", 2); gltfJson.Add("asset", assetJson); var materialsJson = new MyJson_Array(); gltfJson.Add("materials", materialsJson); var extensionsRequired = new MyJson_Array(); extensionsRequired.AddString("KHR_techniques_webgl"); extensionsRequired.AddString("paper"); gltfJson.Add("extensionsRequired", extensionsRequired); var extensionsUsed = new MyJson_Array(); extensionsUsed.AddString("KHR_techniques_webgl"); extensionsUsed.AddString("paper"); gltfJson.Add("extensionsUsed", extensionsUsed); // gltfJson.SetInt("version", 4); //Unifrom or Defines var materialType = this.GetMaterialType(); var writer = MaterialWriterFactory.Create(materialType, target); var materialItemJson = writer.Write(); materialsJson.Add(materialItemJson); writer.Clean(); // gltfJson.isWithFormat = true; var jsonStr = gltfJson.ToString(); return(System.Text.Encoding.UTF8.GetBytes(jsonStr)); }