#unity/日常积累 这个接口,只会拷贝文件内容,不会修改文件名,例如数据库缓存,可以使用它,把备份数据库,替换正常的数据库文件,逻辑参考: ``` cs /// /// 从备份数据库中,恢复数据库 /// /// /// /// private bool BackupDB(string backupPath,string dbPath) { if (File.Exists(backupPath)) { File.Copy(backupPath,dbPath,true); Debug.Log("已从备份恢复数据库"); return true; } else { File.Delete(dbPath); Debug.LogError("无备份可用,已删除 损坏数据库"); return false; } } ```