ドキュメント

Unity Engine

Unity Engine

CopyFileOrDirectory(string, string)

Copies a file or a directory.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule
public static void CopyFileOrDirectory(string source, string dest)

Parameters

source


dest

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
dest
argument.

Examples

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