UActorComponent::OnRegister | Unreal Engine Documentation
USceneComponent::OnAttachmentChanged | Unreal Engine Documentation
class MY_API UMyCMP : public USceneComponent {
//...
#if WITH_EDITOR
virtual void OnRegister() override;
virtual void OnAttachmentChanged() override;
#endif
}
When you attach a scene component or create one, the editor call those methods on your component class.
But for what you’re saying, I think you want something like this:
AActor::PostEditChangeProperty | Unreal Engine Documentation