I cant get this to work right for some reason. I have tried Resources and AssetDatabase to run this from but keep getting a null object from it. This is in editor and not runtime. importPath shows up correctly but impObject returns a null object. Any ideas?
var prefabPath : String = assetPath.Replace(".fbx", "Prefab.prefab");
var importPath : String = assetPath;
Debug.Log(importPath);
var impObject : GameObject = Resources.LoadAssetAtPath(importPath, GameObject) as GameObject;
Debug.Log(impObject);
↧