Ejemplo n.º 1
0
        public async System.Threading.Tasks.Task RefreshAllSaveFiles()
        {
            await Thread.AsyncDummyClass.DummyFunc();

            var files = FileManager.GetFiles(FileManager.ProjectContent, "*.gms", System.IO.SearchOption.AllDirectories);

            foreach (var i in files)
            {
                var rn  = FileManager._GetRelativePathFromAbsPath(i, FileManager.ProjectContent);
                var obj = await MeshManager.CreateMeshAsync(RenderContext, RName.GetRName(rn));

                if (obj != null)
                {
                    obj.SaveMesh();
                }
            }
            files = FileManager.GetFiles(FileManager.ProjectContent, "*.material", System.IO.SearchOption.AllDirectories);
            foreach (var i in files)
            {
                var rn  = FileManager._GetRelativePathFromAbsPath(i, FileManager.ProjectContent);
                var obj = await MaterialManager.GetMaterialAsync(RenderContext, RName.GetRName(rn));

                if (obj != null)
                {
                    obj.SaveMaterial();
                }
            }
            files = FileManager.GetFiles(FileManager.ProjectContent, "*.instmtl", System.IO.SearchOption.AllDirectories);
            foreach (var i in files)
            {
                var rn  = FileManager._GetRelativePathFromAbsPath(i, FileManager.ProjectContent);
                var obj = await MaterialInstanceManager.GetMaterialInstanceAsync(RenderContext, RName.GetRName(rn));

                if (obj != null)
                {
                    obj.SaveMaterialInstance();
                }
            }
        }