Ejemplo n.º 1
0
        private static GameObject ImportGLTF(string filepath, ImportSettings importSettings, out AnimationClip[] animations)
        {
            string json = File.ReadAllText(filepath);

            // Parse json
            GLTFObject gltfObject = JsonConvert.DeserializeObject <GLTFObject>(json);

            return(gltfObject.LoadInternal(filepath, null, 0, importSettings, out animations));
        }
Ejemplo n.º 2
0
        private static GameObject ImportGLB(string filepath, ImportSettings importSettings, out AnimationClip[] animations)
        {
            FileStream stream = File.OpenRead(filepath);
            long       binChunkStart;
            string     json       = GetGLBJson(stream, out binChunkStart);
            GLTFObject gltfObject = JsonConvert.DeserializeObject <GLTFObject>(json);

            return(gltfObject.LoadInternal(filepath, null, binChunkStart, importSettings, out animations));
        }
Ejemplo n.º 3
0
        private static GameObject ImportGLB(byte[] bytes, ImportSettings importSettings, out AnimationClip[] animations)
        {
            Stream     stream = new MemoryStream(bytes);
            long       binChunkStart;
            string     json       = GetGLBJson(stream, out binChunkStart);
            GLTFObject gltfObject = JsonConvert.DeserializeObject <GLTFObject>(json);

            return(gltfObject.LoadInternal(null, bytes, binChunkStart, importSettings, out animations));
        }