void CopyPath(string sourcePath, string destinationPath)
{
DirectoryInfo di = new DirectoryInfo(destinationPath);
if (di.Exists == false)
{
di.Create();
}
DirectoryInfo diSource = new DirectoryInfo(sourcePath);
if (diSource.Exists == false)
{
Debug.LogError("원본파일이 없습니다");
return;
}
if (System.IO.Directory.Exists(sourcePath))
{
string[] files = System.IO.Directory.GetFiles(sourcePath);
// Copy the files and overwrite destination files if they already exist.
foreach (string s in files)
{
if (s.IndexOf(".meta") >= 0)
{
continue;
}
// Use static Path methods to extract only the file name from the path.
string fileName = System.IO.Path.GetFileName(s);
string destFile = System.IO.Path.Combine(destinationPath, fileName);
System.IO.File.Copy(s, destFile, true);
}
}
else
{
Debug.LogError("error");
}
}
'Unity > 코드 예제들' 카테고리의 다른 글
타일맵 (0) | 2021.04.02 |
---|---|
com.unity.localization (0) | 2021.03.15 |
배열을 Dictionary로 사용. 직열화, 인터팩터 창에 출력가능. (0) | 2020.11.19 |
모바일 네트워크 상태 확인 (0) | 2020.10.30 |
NGUI 게임도중에 orientation을 이용해 가로세로전환 (0) | 2020.06.16 |