Hello,
I use scripted gameobject generation in UnityEditor like this:
GameObject temp = (GameObject)AssetDatabase.LoadAssetAtPath("Assets/media/tiles/Tile.prefab", typeof(GameObject)); GameObject go = (GameObject)GameObject.Instantiate(temp);
It works fine, I’m able to generate many those objects. But I have one problem. This prefab has several child objects in it.
Tile.prefab
-objectA
-objectB
-objectC
If I click on this Instantiated object in unity editor it select one of child objects. But if I put same prefab into scene by drag and drop instead of script, when I click on it, it is selected as whole.
Is some solution to fix this problem?