- Home /
Question by
danieilng21 · Jan 11, 2019 at 03:58 PM ·
instantiateassetbundlename
Get instantiated name even before loading the asset from bundle
How to get the instantiated game object name / asset name - which is usually has capital letters even before loading an asset from the assetbundle (usually with small cap and name could be quite different from instantiated object)?
e.g. assetbundle.GetAllAssetNames().[1] and get string = ".../machinegun.obj";
trim it to "machinegun", instantiate game object of loaded asset - Instantiate( assetbundle.LoadAsset("machinegun")) - and we will get gameobject.name as "Machine Gun(clone)";
I would like to avoid loading an asset, instantiate and destroy it just to get the name ("Machine Gun(clone)" in this case). Hope somebody can help.
Comment