Skip to content

Commit ffc4cdc

Browse files
aidinabediAdamMitchell-ms
authored andcommitted
explicitly pass start position of stream instead of relying on false assumption that GLTFParser.ParseJson won't change it. (KhronosGroup#458)
1 parent 94bdc8e commit ffc4cdc

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

UnityGLTF/Assets/UnityGLTF/Scripts/Editor/GLTFImporter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ private GameObject CreateGLTFScene(string projectFilePath)
342342
{
343343
GLTFRoot gLTFRoot;
344344
GLTFParser.ParseJson(stream, out gLTFRoot);
345+
stream.Position = 0; // Make sure the read position is changed back to the beginning of the file
345346
var loader = new GLTFSceneImporter(gLTFRoot, stream, importOptions);
346347
loader.MaximumLod = _maximumLod;
347348
loader.IsMultithreaded = true;

0 commit comments

Comments
 (0)