Version: 1.7
LanguageEnglish
  • C#

InstantAssetTable.GetAssetDependencies

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 string[] GetAssetDependencies(string path);

Parameters

path The asset path to query dependencies for. Pass empty string ("") to get all dependencies in the table.

Returns

string[] String[] - Array of file paths representing the asset's dependencies.

Description

Retrieves a list of file dependencies for a specific asset path.

These dependencies include external files that the asset relies on, such as textures, materials, or other referenced assets. When called with an empty string, returns all asset dependencies in the table.

using UnityEngine;

public class DependencyExample : MonoBehaviour { public InstantAssetTable assetTable; void Start() { // Get dependencies for a specific asset string[] dependencies = assetTable.GetAssetDependencies("assets/models/player.fbx"); Debug.Log($"Player model has {dependencies.Length} dependencies:"); foreach (string dep in dependencies) { Debug.Log($" - {dep}"); } // Get all dependencies in the table string[] allDependencies = assetTable.GetAssetDependencies(""); Debug.Log($"Total dependencies in table: {allDependencies.Length}"); } }