ThreeSceneRoot BuildThreeSceneRoot(UnitySceneRoot root) { var report = new Report("ThreeSceneConvert"); report.UseConsole = false; var visitor = new ThreeSceneConvertVisitor(report); return(visitor.Run(unitySceneRoot)); }
public SceneExporter(GameObject[] gos, string targetFilePath) { pathHelper = new ExportPathHelper(targetFilePath); unitySceneRoot = new UnitySceneRoot(); foreach (var go in gos) { unitySceneRoot.Add(go); } }
UnitySceneRoot BuildUnitySceneRoot(GameObject[] gos) { var root = new UnitySceneRoot(); foreach (var go in gos) { root.Add(go); } return(root); }
void DumpUnitySceneRoot(UnitySceneRoot root) { var report = new Report("unity-scene-dump"); report.UseConsole = false; var dumpVisitor = new DumpVisitor(report); dumpVisitor.Run(root); report.SaveReport("unity-scene.log"); }
public SceneExporter(GameObject[] gos) { unitySceneRoot = BuildUnitySceneRoot(gos); }
public void Run(UnitySceneRoot root) { report.Info("# Project Settings"); Visit(root.Settings); report.Info(""); // containers report.Info("# Material"); foreach (var n in root.ContainerTable.GetEnumerable <MaterialContainer>()) { Visit(n); report.Info(""); } report.Info("# Texture"); foreach (var n in root.ContainerTable.GetEnumerable <TextureContainer>()) { Visit(n); report.Info(""); } /* * TODO * report.Info("# Lightmap"); * foreach (var x in n.LightmapEnumerable) { * Visit(x.Value); * report.Info(""); * } */ // scene graph report.Info("# Mesh"); foreach (var n in root.ContainerTable.GetEnumerable <MeshContainer>()) { Visit(n); report.Info(""); } // component report.Info("# Render"); foreach (var n in root.GraphNodeTable.GetEnumerable <RenderNode>()) { Visit(n); report.Info(""); } report.Info("# Camera"); foreach (var n in root.GraphNodeTable.GetEnumerable <CameraNode>()) { Visit(n); report.Info(""); } report.Info("# Light"); foreach (var n in root.GraphNodeTable.GetEnumerable <LightNode>()) { Visit(n); report.Info(""); } report.Info("# Script"); foreach (var n in root.GraphNodeTable.GetEnumerable <ScriptNode>()) { Visit(n); report.Info(""); } // gameobject report.Info("# GameObject"); foreach (var n in root.GraphNodeTable.GetEnumerable <GameObjectNode>()) { Visit(n); report.Info(""); } }