I’ve just found that the function AssetDatabase.GetDependencies doesn’t seem to work for my purpose. I was hoping to be able to pass one pathName to the function and get a list of the assets it depends on. The returned string[ ] only contains the prefab name when I do this though. When I pass two or more prefab names, I get a list of assets which appears to be assets they all share, which doesn’t help me.
I’ve tried to find a different approach to the problem but I am stuck now. How can I find out what assets a prefab needs?
Obviously Unity knows what assets to load when I call Resources.Load on a prefab, but it doesn’t seem to be exposed to the users. Do I really have to parse the prefab file to get this information?
I will sort of answer the question myself. The issue isn’t with the function, the issue is in the prefab itself. I will continue to investigate the issue, but I can verify that the function DOES work for a single pathName. One can argue it’s wierd that the function doesn’t contain overloads for single files though.