The RenameDirectory
method in the Editor.EditorUtility
class is used to rename a directory within the editor environment. This method allows you to specify whether the renaming should be applied recursively to all subdirectories and files.
The RenameDirectory
method in the Editor.EditorUtility
class is used to rename a directory within the editor environment. This method allows you to specify whether the renaming should be applied recursively to all subdirectories and files.
To use the RenameDirectory
method, provide the current directory path, the new directory name, and a boolean indicating whether the operation should be recursive. This method is static and can be called directly on the Editor.EditorUtility
class.
// Example usage of RenameDirectory string currentDirectory = "Assets/OldDirectoryName"; string newDirectoryName = "Assets/NewDirectoryName"; bool applyRecursively = true; Editor.EditorUtility.RenameDirectory(currentDirectory, newDirectoryName, applyRecursively);