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.