I Have been searching for a bit and didn’t find any thing on this topic.
Thanks!
You can use OnEnable() and OnDisable().