Пример #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));
        }
Пример #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));
        }
Пример #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));
        }