# IDebugOnRemoved

> Implement this interface on a component type to receive a callback when Unity removes that component from an entity.

## Definition

* **Type:** Interface
* **Namespace:** [Unity.Entities](/engine/7000.0/script-reference/unity/entities.md)
* **Assembly:** UnityEngine.EntitiesModule

```csharp
public interface IDebugOnRemoved
```

## Remarks

A component type that implements this interface must also declare a matching callback method:

@@@@@@cs public static void OnRemoved(Entity entity, in T component) @@@@@@

where `T` is the component type. The method must be public and static, must return `void`, and must take an [Entity](/engine/7000.0/script-reference/unity/entities/entity.md) followed by an `in` parameter of the component's own type.

Unity calls the callback once for each entity that the component is removed from, including when you destroy an entity that has the component. Unity compiles the callback into the Editor and into development builds, and excludes it from release builds.

Set a breakpoint in the callback to inspect the call stack and check what removed the component.

For more information, refer to Component lifecycle callbacks.

Additional Resources: [IDebugOnAdded](/engine/7000.0/script-reference/unity/entities/idebugonadded.md)
