Example #1
0
        private void CreateAssetManifest(string targWeb, IEnumerable <string> textureList)
        {
            List <string> filePaths = new List <string>();

            if (textureList != null)
            {
                foreach (string texture in textureList)
                {
                    filePaths.Add(Path.Combine(targWeb, texture));
                }
            }

            // filePaths = textureList.ToList(); // Directory.GetFiles(Path.Combine(targDir, "Assets")).ToList();
            filePaths.Add(Path.Combine(targWeb, "Assets", "Model.fus"));
            filePaths.Add(Path.Combine(targWeb, "Assets", "FuseeLogo150.png"));
            filePaths.Add(Path.Combine(targWeb, "Assets", "Lato-Black.ttf"));
            filePaths.Sort(string.Compare);

            // Load custom implementations first
            var fileCount = 0;

            var externalFiles = new[]
            {
                "Fusee.Base.Core.Ext",
                "Fusee.Base.Imp.Web.Ext",
                "opentype",
                "Fusee.Xene.Ext",
                "Fusee.Xirkit.Ext",
                "Fusee.Engine.Imp.Graphics.Web.Ext",
                "SystemExternals",

                //"Fusee.Engine.Imp.WebAudio", "Fusee.Engine.Imp.WebNet", "Fusee.Engine.Imp.WebGL",
                //"Fusee.Engine.Imp.WebInput", "XirkitScript", "WebSimpleScene"
            };

            foreach (var extFile in externalFiles)
            {
                var exists = File.Exists(Path.Combine(targWeb, "Assets", "Scripts", extFile + ".js"));

                if (exists)
                {
                    var filePath = Path.Combine(targWeb, "Assets", "Scripts", extFile + ".js");
                    filePaths.Insert(fileCount, filePath);
                    fileCount++;
                }
                else
                {
                    Logger.Error("Couldn't find " + extFile + ".js");
                    return;
                }
            }

            var destRelativePaths = MakeAssetRelativePaths(filePaths, targWeb);
            // Create manifest
            string fileName        = "Fusee.Engine.SceneViewer.Web";
            var    manifest        = new ManifestFile(fileName, filePaths, destRelativePaths, fileCount);
            string manifestContent = manifest.TransformText();

            File.WriteAllText(Path.Combine(targWeb, "Assets", "Scripts", fileName + ".contentproj.manifest.js"),
                              manifestContent);
        }
Example #2
0
        private void CreateAssetManifest(string targWeb, IEnumerable<string> textureList)
        {
            List<string> filePaths;

            filePaths = textureList.ToList(); // Directory.GetFiles(Path.Combine(targDir, "Assets")).ToList();
            filePaths.Add("Assets/Model.fus");
            filePaths.Add("Assets/FuseeLogo150.png");
            filePaths.Add("Assets/Lato-Black.ttf");
            filePaths.Sort(string.Compare);

            // Load custom implementations first
            var fileCount = 0;

            var externalFiles = new[]
            {
                "Fusee.Engine.Imp.WebAudio", "Fusee.Engine.Imp.WebNet", "Fusee.Engine.Imp.WebGL",
                "Fusee.Engine.Imp.WebInput", "XirkitScript",
            };

            foreach (var extFile in externalFiles)
            {
                var exists = File.Exists(Path.Combine(targWeb, "Assets", "Scripts", extFile + ".js"));

                if (exists)
                {
                    filePaths.Insert(fileCount, Path.Combine(targWeb, "Assets", "Scripts", extFile + ".js"));
                    fileCount++;
                }
                else
                {
                    Logger.Error("Couldn't find " + extFile + ".js");
                    return;
                }
            }

            // Create manifest
            string fileName = "Examples.SceneViewer";
            var manifest = new ManifestFile(fileName, filePaths, fileCount);
            string manifestContent = manifest.TransformText();

            File.WriteAllText(Path.Combine(targWeb, "Assets", "Scripts", fileName + ".contentproj.manifest.js"),
                manifestContent);
        }