Example #1
0
        private static void ExportFromMenu()
        {
            var go   = Selection.activeObject as GameObject;
            var path = EditorUtility.SaveFilePanel(
                "Save glb",
                "",
                go.name + ".glb",
                "glb");

            if (string.IsNullOrEmpty(path))
            {
                return;
            }

            using (var exporter = new gltfExporter(new glTF()))
            {
                exporter.Prepare(go);
                exporter.Export();
                exporter.WriteTo(path);
            }
        }