RequireComponent for built in components

I am curious to know if there is any way we can use RequireComponent for Unity’s built in components like SpriteRenderer. So when I add SpriteRenderer, another component is added automatically or is this only possible for user defined components?
Another workaround will be to listen to an event. Is there any way to know when a SpriteRenderer gets created. Maybe some event gets fired?
If one of these is possible, my work will become a lot easier.


You can use RequireComponent for whatever you want. However, to do what you’re suggesting you would need to access the SpriteRenderer script which isn’t possible (unless that’s part of the OpenSource UI stuff, in which case you can).

Your best bet is to write a new script, and have that Require a SpriteRenderer. In that components Awake call you can have it take some action (including check if the sprite renderer is actually active).