In this scenario, instead of un-publishing component, un-publish component template.
Un-publishing of component template will take care of the unpublishing components published using that template.
Update
If component template is referring to more than one schema and you want to unpublish components only related to one schema then update custom resolver to perform that validation and remove other components while unpublishing component template.