internal static void ApplyPrefabRemovedComponent(object userData) { ObjectInstanceAndSourceInfo info = (ObjectInstanceAndSourceInfo)userData; string path = AssetDatabase.GetAssetPath(info.correspondingObjectInSource); if (!PrefabUtility.PromptAndCheckoutPrefabIfNeeded(path, PrefabUtility.SaveVerb.Apply)) { return; } PrefabUtility.ApplyRemovedComponent((GameObject)info.instanceObject, (Component)info.correspondingObjectInSource, InteractionMode.UserAction); EditorUtility.ForceReloadInspectors(); }