internal static void DoMounts(IResourceManagerInternal res, MountOptions?options, string contentBuildDir, ResourcePath assembliesPath, bool loadContentResources = true, bool loader = false, bool contentStart = false) { #if FULL_RELEASE if (!loader) { res.MountContentDirectory(@"Resources/"); } #else res.MountContentDirectory($@"{FindEngineRootDir(contentStart)}Resources/"); if (loadContentResources) { var contentRootDir = FindContentRootDir(contentStart); res.MountContentDirectory($@"{contentRootDir}bin/{contentBuildDir}/", assembliesPath); res.MountContentDirectory($@"{contentRootDir}Resources/"); } #endif if (options == null) { return; } foreach (var diskPath in options.DirMounts) { res.MountContentDirectory(diskPath); } foreach (var diskPath in options.ZipMounts) { res.MountContentPack(diskPath); } }
internal static void DoMounts(IResourceManagerInternal res, MountOptions?options, string contentBuildDir, bool loader = false, bool contentStart = false) { #if FULL_RELEASE if (!loader) { res.MountContentDirectory(@"Resources/"); } #else var contentRootDir = FindContentRootDir(contentStart); res.MountContentDirectory($@"{contentRootDir}RobustToolbox/Resources/"); res.MountContentDirectory($@"{contentRootDir}bin/{contentBuildDir}/", new ResourcePath("/Assemblies/")); res.MountContentDirectory($@"{contentRootDir}Resources/"); #endif if (options == null) { return; } foreach (var diskPath in options.DirMounts) { res.MountContentDirectory(diskPath); } foreach (var diskPath in options.ZipMounts) { res.MountContentPack(diskPath); } }
public static void MountString(this IResourceManagerInternal resourceManager, string path, string content) { if (path.Contains("\n")) { throw new ArgumentException("Mount path contains newline. Did you mix up mount path and content?"); } var stream = new MemoryStream(); stream.Write(Encoding.UTF8.GetBytes(content)); stream.Position = 0; resourceManager.MountStreamAt(stream, new ResourcePath(path)); }