Version: 5.4

FileUtil.MoveFileOrDirectory

Switch to Manual
public static void MoveFileOrDirectory (string from, string to);

Description

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

Путь в этой функции может задаваться относительно корневой папки проекта или в абсолютной адресации.

Все разделители файлов должны начинаться с единичной косой черты "/".

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" ); } }