Version: 1.8
LanguageEnglish
  • C#

AssetDatabase.GetGUIDDependencies

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static GUID[] GetGUIDDependencies(string[] pathNames, bool recursive);

Parameters

pathNames The path to the asset for which dependencies are required.
recursive Controls whether this method recursively checks and returns all dependencies including indirect dependencies (when set to true), or whether it only returns direct dependencies (when set to false).

Returns

GUID[] The guids of all assets that the input depends on.(Including missing assets).

Description

Returns an array of all the assets's GUIDs that are dependencies of the asset at the specified pathName.(Including missing assets).

Note: GetGUIDDependencies() gets the Assets's GUIDs that are referenced by other Assets. For example, a Scene could contain many GameObjects with a Material attached to them. In this case, GetGUIDDependencies() will return the guid to the Material Assets, but not the GameObjects as those are not Assets on your disk.

If recursive is true, the list returned will also include the input path itself. Note that this function returns all assets that are referenced by the input asset; these references are not necessarily required during the build process.