CodeSmile AssetDatabase 1.9
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
Loading...
Searching...
No Matches

◆ Rename()

void Rename ( String newFileOrFolderName)

Renames the last element of the CodeSmileEditor.Asset.Path instance.

NOTE: This does not rename a file/folder on disk! It renames the Path instance.

When renaming a file you must specifiy the new filename with extension.

Parameters
newFileOrFolderNameName of a folder or file with extension. Does nothing if input is null or empty.

Definition at line 391 of file Asset.Path.cs.

392 {
393 if (String.IsNullOrEmpty(newFileOrFolderName) == false)
394 m_RelativePath = $"{FolderPath}/{System.IO.Path.GetFileName(newFileOrFolderName)}";
395 }