Version: 2021.1
언어: 한국어

FileUtil.MoveFileOrDirectory

매뉴얼로 전환
public static void MoveFileOrDirectory (string source, string dest);

설명

Moves a file or a directory from a given path to another path.

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 "to" argument.

using UnityEngine;
using UnityEditor;

public class MoveFile : MonoBehaviour { [MenuItem("Example/Move Something")] static void MoveSomething() { FileUtil.MoveFileOrDirectory("sourcepath/YourFileOrFolder", "destpath/YourFileOrFolder"); } }