2
\$\begingroup\$

We have made different types of prefabs, if we want to change small thing in all prefabs, we do drag all those prefabs to scene ,create script which will do its required work .All is fine till now after that problem arises for saving those prefabs.We need to manually click "Apply" on all prefabs.

Has there anyway where we can dynamically use "Apply" feature via script?

\$\endgroup\$
1
\$\begingroup\$

I found a workaround,use following code to do it so,

PrefabUtility.ReplacePrefab(gameObject, PrefabUtility.GetPrefabParent(gameObject), ReplacePrefabOptions.ConnectToPrefab);

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.