Version: 2017.3

FileUtil.CopyFileOrDirectory

Cambiar al Manual
public static void CopyFileOrDirectory (string source, string dest);

Descripción

Copia un archivo o directorio.

This function's path can be relative to the project root folder or be an absolute path.

All file separators should be forward ones "/".

Make sure to include the name of the files or directories at the end of the "to" argument.

using UnityEngine;
using UnityEditor;

public class CopyFile : MonoBehaviour { [MenuItem("Example/Copy Something")] static void CopySomething() { FileUtil.CopyFileOrDirectory("sourcepath/YourFileOrFolder", "destpath/YourFileOrFolder"); } }