Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Rutime API

ousttrue edited this page Jul 20, 2018 · 6 revisions

Import

            var bytes = File.ReadAllBytes(path);

            var context = new ImporterContext();
            var ext = Path.GetExtension(path).ToLower();
            if (ext == ".glb")
            {
                context.ParseGlb(bytes);
            }
            else
            {
                context.ParseJson(Encoding.UTF8.GetString(bytes), new FileSystemStorage(Path.GetDirectoryName(path)));
            }

            gltfImporter.Import(context);
            context.Root.name = Path.GetFileNameWithoutExtension(path);
            context.ShowMeshes();

            GameObject go = context.Root;
Clone this wiki locally