How to reset component properties from script

Hello!
I am working on an editor script to reset the properties of a component which we do by clicking the reset button from the context menu. How would I simulate this behavior from script? I know there is MonoBehavior.Reset but I want to reset non mono-behavior components i.e. SpriteRenderer, Collider,…

Thanks

What you need to do is destroy the component , and then add the component this will reset it.

Hi @THEAK472009! Unfortunately this is not possible. Many Component types defined on the native side do not implement a Reset method in managed code, and so the context menu item is only ever executing native code.