/// <summary> /// Performs the setup. /// </summary> /// <param name="assetsRootFolder">Assets root folder.</param> /// <param name="log">Log.</param> public static void Setup(string assetsRootFolder, ILog log) { Log = log; Log.Debug("MetadataBootstrap.Setup: {0}", assetsRootFolder); FileSystem = new IsolatedFolderFileSystem(assetsRootFolder); AssemblyLoader = new ReflectionAssemblyLoader(FileSystem); TypeService = new TypeService(FileSystem, AssemblyLoader); MetaFileService.Initialize(FileSystem); ScriptMetadataService = new ScriptMetadataService(TypeService); PrefabMetadataReader = new YamlPrefabMetadataReader(ScriptMetadataService, FileSystem); PrefabMetadataWriter = new YamlPrefabMetadataWriter(FileSystem, Log); PrefabMetadataService = new PrefabMetadataService(PrefabMetadataReader, PrefabMetadataWriter, FileSystem, TypeService); AssetRepository = new AssetDatabaseAssetRepository(); }
public void GetFileNameByGuid_Guids_FileNames() { var fs = new IsolatedFolderFileSystem(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources")); MetaFileService.Initialize(fs); var actual = MetaFileService.GetFileNameByGuid("a3646ea8c53c6ec448c7c9d27568d982"); StringAssert.EndsWith("Buildron.ClassicMods.BuildMod.dll", actual); actual = MetaFileService.GetFileNameByGuid("3049dffabc5225d40b27675901977fdd"); StringAssert.EndsWith("FireballA.mat", actual); fs = new IsolatedFolderFileSystem(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Resources", "Materials")); MetaFileService.Initialize(fs); actual = MetaFileService.GetFileNameByGuid("a3646ea8c53c6ec448c7c9d27568d982"); Assert.IsNull(actual); actual = MetaFileService.GetFileNameByGuid("3049dffabc5225d40b27675901977fdd"); StringAssert.EndsWith("FireballA.mat", actual); }