コード例 #1
0
        public static GLTFRoot ParseJson(Stream stream, long startPosition = 0)
        {
            stream.Position = startPosition;
            // Check for binary format magic bytes
            if (IsGLB(stream))
            {
                ParseJsonChunk(stream, startPosition);
            }
            else
            {
                stream.Position = startPosition;
            }

            return(GLTFRoot.Deserialize(new StreamReader(stream)));
        }
コード例 #2
0
        public static void ParseJson(Stream stream, out GLTFRoot gltfRoot, long startPosition = 0)
        {
            stream.Position = startPosition;
            // Check for binary format magic bytes
            if (IsGLB(stream))
            {
                ParseJsonChunk(stream, startPosition);
            }
            else
            {
                stream.Position = startPosition;
            }

            gltfRoot = GLTFRoot.Deserialize(new StreamReader(stream));
        }
コード例 #3
0
        public static GLTFRoot ParseString(string gltfContent)
        {
            var stringReader = new StringReader(gltfContent);

            return(GLTFRoot.Deserialize(new JsonTextReader(stringReader)));
        }
コード例 #4
0
        private static GLTFRoot ParseString(string gltfContent)
        {
            var stringReader = new StringReader(gltfContent);

            return(GLTFRoot.Deserialize(stringReader));
        }