Skip to content

Instantly share code, notes, and snippets.

@jbroadway
jbroadway / Remove Component.md
Created August 23, 2017 01:43
Unity3D editor script to remove a component from all children of an object

Unity3D editor script to remove a component from all children of an object

Usage:

  1. Save the file to your Assets/Editor folder.
  2. Modify the classes to refer to the ComponentName you want removed.
  3. Attach RemoveComponentName component to the root GameObject the components should be removed from.
  4. Click the "Remove ComponentName" button in the inspector.
  5. Remove the RemoveComponentName component when you're done.