I'm working on a tool that will build a 2D level based on info from a text file.
When the text file is imported, I want to create instances of the game objects that retain their connection to a prefab.
In Unity 4, when I do this:
Object prefabRoot = EditorUtility.GetPrefabParent (sprite);
GameObject dupe = EditorUtility.InstantiatePrefab (prefabRoot) as GameObject;
the `dupe` object is null.
The documentation seems to suggest that it shouldn't return null.
- http://docs.unity3d.com/Documentation/ScriptReference/PrefabUtility.InstantiatePrefab.html
If InstantiatePrefab will always return null, is there any other way to accomplish what I'm trying to do?
↧