ドキュメント

Unity Engine

Unity Engine

MoveFileOrDirectory(string, string)

Moves a file or a directory from a given path to another path.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

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

Parameters

source


dest

Remarks

This function's path is relative to the project root folder but it can also accept absolute paths.
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 MoveFile : MonoBehaviour{ [MenuItem("Example/Move Something")] static void MoveSomething() { FileUtil.MoveFileOrDirectory("sourcepath/YourFileOrFolder", "destpath/YourFileOrFolder"); }}