/// <summary> /// 创建文件系统。 /// </summary> /// <param name="fullPath">要创建的文件系统的完整路径。</param> /// <param name="access">要创建的文件系统的访问方式。</param> /// <param name="maxFileCount">要创建的文件系统的最大文件数量。</param> /// <param name="maxBlockCount">要创建的文件系统的最大块数据数量。</param> /// <returns>创建的文件系统。</returns> public IFileSystem CreateFileSystem(string fullPath, FileSystemAccess access, int maxFileCount, int maxBlockCount) { if (m_FileSystemHelper == null) { throw new GameFrameworkException("File system helper is invalid."); } if (string.IsNullOrEmpty(fullPath)) { throw new GameFrameworkException("Full path is invalid."); } if (access == FileSystemAccess.Unspecified) { throw new GameFrameworkException("Access is invalid."); } if (access == FileSystemAccess.Read) { throw new GameFrameworkException("Access read is invalid."); } fullPath = Utility.Path.GetRegularPath(fullPath); if (m_FileSystems.ContainsKey(fullPath)) { throw new GameFrameworkException(Utility.Text.Format("File system '{0}' is already exist.", fullPath)); } FileSystemStream fileSystemStream = m_FileSystemHelper.CreateFileSystemStream(fullPath, access, true); if (fileSystemStream == null) { throw new GameFrameworkException(Utility.Text.Format("Create file system stream for '{0}' failure.", fullPath)); } FileSystem fileSystem = FileSystem.Create(fullPath, access, fileSystemStream, maxFileCount, maxBlockCount); if (fileSystem == null) { throw new GameFrameworkException(Utility.Text.Format("Create file system '{0}' failure.", fullPath)); } m_FileSystems.Add(fullPath, fileSystem); return(fileSystem); }