'Getting Soft removal when DestroyImmediate component from gameObject
I'm writing unity editor script which runs in custom EditorWindow. It selectes the prefab gameObject from inspector.
After picking the gameObject, it goes over each child item, and look for certain component, and checks some value. And if value matches to certain condition, I'm removing the component by calling DestroyImmediate(component, true) and at the end I'm saving prefab gameObject.
Once the script is completed, when I saw the child entities where component is being removed, I can see the component entry is present and is marked disabled.
Inspector shows the component like this
<Component Name> (Script) (Removed)
Also, when I open prefab file in text editor, I can see the same script entry under m_RemovedComponents
Any idea, what could be wrong here. Is there any other way, maybe reflection to properly remove the component without leaving any traces.
Btw I'm using Unity Editor version 2020.3.31f1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
