Override SetActive on a GameObject?

I am trying to debug and find where a gameObject is set to inactive potentially within a group of objects where the SetActive for the specific is not obvious. Is it possible to override SetActive or use some other method to determine which code calls the command?

Just add a Debug.Log inside an OnDisable method of any MonoBehaviour that is attached to the object. The stacktrace of the log entry will contain the origin of the SetActive call.

Just to be clear about your direct question: No, you can’t override SetActive since SetActive is not a virtual method and the GameObject class is actually sealed so you can not derive your class from GameObject.