Is there a way for children to know if a parent is deactivated?

I want children (components) to be notified when they are deactivated (e.g. if their parent is deactivated), is there an event that children can listen to or do I need to notify the children manually on deactivation?

If no event, is there a way for a child to check if it’s active in the scene (if it or its parent has been deactivated)?

Not sure about the events, but every GameObject has a field activeInHierarchy and activeSelf, and you can access the parent through transform.parent.gameObject.

The solution was to use:

public void OnDisable()
{
    // called when this or a parent object is deactivated
}