- Home /
How do I access assets of an asset database .asset file via c# ?
hi, as you know assetddatabases can hold multiple assets as SubAssets. How do I go about accessing and returning thee assets inside of the assetdatabase to a list ?
Here ia an example of my custom .asset file.
Where New Comp typeof (Comp) is a subasset of CompPtoject typeof (CompProject)
Answer by Nischo · Jul 09, 2015 at 10:16 AM
If you have a reference to your asset, or if you have stored in in your Resources Folder and have loaded it via Resources.Load: You can access all "subassets" inside via AssetDatabase.LoadAllAssetsAtPath the array of objects return contain your "container" asset and all child assets.
Thanks !!, I'm unable to even access ANY Load function in AssetBundle.
tried with a new project too; had the same problem.
could it be that I need to have Unity pro in order to access the Load functions .
i wonder how else can i get this done
Never really worked with AssetBundles. But you are trying to call a static method on the class AssetBundle. $$anonymous$$y guess is, you have to load the asset file first, cast it to the class AssetBundle and then call LoadAsset on that instance. Again, this is only a guess.
$$anonymous$$y Bad, i think i understand now what you were doing, and it has nothing to do with AssetBundles. Give me a moment and i will update my answer.
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to : Editor.OnPreviewGUI Implementation 0 Answers
How do I change the default icon of a .asset file ? 1 Answer