Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AssetDatabase.AssetPathToGUID

static function AssetPathToGUID(path: string): string;
static string AssetPathToGUID(string path);
static def AssetPathToGUID(path as string) as string

Parameters

pathFilesystem path for the asset.

Description

Get the GUID for the asset at path.

All paths are relative to the project folder, for example: "Assets/MyTextures/hello.png".