CopyFileOrDirectory(string, string)
Copies a file or a directory.
Read time 1 minuteLast updated 11 days ago
Definition
- Type: Method
- Namespace: UnityEditor
- Assembly: UnityEditor
public static void CopyFileOrDirectory(string source, string dest)
Parameters
Remarks
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 argument.
destExamples
using UnityEngine;using UnityEditor;public class CopyFile : MonoBehaviour{ [MenuItem("Example/Copy Something")] static void CopySomething() { FileUtil.CopyFileOrDirectory("sourcepath/YourFileOrFolder", "destpath/YourFileOrFolder"); }}