AssetDatabase.RenameAsset Manual     Reference     Scripting  
Scripting > Editor Classes > AssetDatabase
AssetDatabase.RenameAsset

static function RenameAsset (pathName : string, newName : string) : string

Parameters

NameDescription
pathName the path where the asset currently resides
newName the new name which should be given to the asset.

Returns

string - an empty string, if the asset has been successfully renamed, and an error string otherwise. All paths are relative to the project folder. Like: "Assets/MyTextures/hello.png"

Description

Rename an asset file.