Question by
AchillePACEPro · 4 days ago ·
c#prefabunityeditor
Comparing a gameObject's source prefab with a prefab
Hello ! I want to make a script, that given 3 prefab references will check inside prefab 1's children for the presence of prefab 2 instance, and replace them with prefab 3 instances. This will be running in editor. I couldn't find any way to instantiate directly inside a prefab, so I tried to instantiate the prefab 1, make the modification I needed, then apply the changes to the prefab, and destroy the instantiated prefab. But, when instantiated, the part of the code where I compare the children's source prefab, with the referenced prefab doesn't work anymore. Is there anything I could be doing wrong ?
screen1.png
(63.1 kB)
screen2.png
(20.6 kB)
Comment