CopyTool

来源:互联网 发布:风暴大陆神兵进阶数据 编辑:程序博客网 时间:2024/05/16 01:38
using UnityEngine;using UnityEditor;using System.Collections;using System.IO;public class CopyTool : Editor {public string sourcePath = string.Empty;public string targetPath = string.Empty;public void Copy(){//Now Create all of the directoriesforeach (string dirPath in Directory.GetDirectories(sourcePath, "*",     SearchOption.AllDirectories))    Directory.CreateDirectory(dirPath.Replace(sourcePath, targetPath));//Copy all the filesforeach (string newPath in Directory.GetFiles(sourcePath, "*.*",     SearchOption.AllDirectories))    File.Copy(newPath, newPath.Replace(sourcePath, targetPath), true);Debug.Log("Copied all");}}