Skip to content

Commit a642641

Browse files
robertdorn83marwie
authored andcommitted
removed obsolete warning for KTX > 3.5 and Draco > 5.2
1 parent 4eeb7a3 commit a642641

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

Runtime/Scripts/SceneImporter/ImporterMeshes.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,11 @@ protected virtual DracoDecodeResult ConstructDracoMesh(GLTFMesh mesh, int meshIn
300300

301301
if (dracoExtension.attributes.TryGetValue(SemanticProperties.POSITION, out var positionAttr))
302302
attrMap.Add( VertexAttribute.Position, positionAttr);
303-
303+
#if HAVE_DRACO_VERSION_5_2
304+
decodeResult.decodeResults[i] = DracoDecoder.DecodeMesh( _assetCache.MeshCache[meshIndex].DracoMeshData[i], bufferViewData.AsReadOnly(), decodeSettings, attrMap);
305+
#else
304306
decodeResult.decodeResults[i] = DracoDecoder.DecodeMesh( _assetCache.MeshCache[meshIndex].DracoMeshData[i], bufferViewData, decodeSettings, attrMap);
307+
#endif
305308

306309
#else
307310
var draco = new DracoMeshLoader();

Runtime/Scripts/SceneImporter/ImporterTextures.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,11 @@ async Task<Texture2D> CheckMimeTypeAndLoadImage(GLTFImage image, Texture2D textu
276276
#endif
277277
var ktxTexture = new KtxUnity.KtxTexture();
278278

279+
#if HAVE_KTX_VERSION_3_5
280+
var resultTextureData = await ktxTexture.LoadFromBytes(data.AsReadOnly(), isLinear, mipChain: GenerateMipMapsForTextures);
281+
#else
279282
var resultTextureData = await ktxTexture.LoadFromBytes(data, isLinear, mipChain: GenerateMipMapsForTextures);
283+
#endif
280284
texture = resultTextureData.texture;
281285
texture.name = textureName;
282286
}

Runtime/UnityGLTFScripts.asmdef

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@
8787
"name": "com.unity.cloud.draco",
8888
"expression": "5.0.0",
8989
"define": "HAVE_DRACO_VERSION_5"
90+
},
91+
{
92+
"name": "com.unity.cloud.ktx",
93+
"expression": "3.5.0",
94+
"define": "HAVE_KTX_VERSION_3_5"
95+
},
96+
{
97+
"name": "com.unity.cloud.draco",
98+
"expression": "5.2.0",
99+
"define": "HAVE_DRACO_VERSION_5_2"
90100
}
91101
],
92102
"noEngineReferences": false

0 commit comments

Comments
 (0)