您的位置:首页 > 运维架构

CopyTool

2013-08-24 14:21 120 查看
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 directories
foreach (string dirPath in Directory.GetDirectories(sourcePath, "*",
SearchOption.AllDirectories))
Directory.CreateDirectory(dirPath.Replace(sourcePath, targetPath));

//Copy all the files
foreach (string newPath in Directory.GetFiles(sourcePath, "*.*",
SearchOption.AllDirectories))
File.Copy(newPath, newPath.Replace(sourcePath, targetPath), true);

Debug.Log("Copied all");
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Unity3d c#