private AssetDependencies AcquireAssetDependencies(string assetPath) { AssetDependencies depends; if (!m_AssetDependencies.TryGetValue(assetPath, out depends)) { depends = new AssetDependencies(assetPath); m_AssetDependencies.Add(assetPath, depends); } return(depends); }
public void TrackDependencies(string assetPath) { SuperAsset super = AssetDatabase.LoadAssetAtPath <SuperAsset>(assetPath); if (super != null) { // Keep track of our dependencies AssetDependencies depends = AcquireAssetDependencies(assetPath); depends.AssignDependencies(super.AssetDependencies); // Remove our reference from all other assets foreach (var dep in m_AssetDependencies.Values) { dep.RemoveReference(assetPath); } // Add our reference to assets we are now dependent on foreach (var path in super.AssetDependencies) { AssetDependencies reference = AcquireAssetDependencies(path); reference.AddReference(assetPath); } } }
public bool GetAssetDependencies(string assetPath, out AssetDependencies depends) { return(m_AssetDependencies.TryGetValue(assetPath, out depends)); }