Refreshing the Polygon Collider (2D) upon sprite change?

Let’s say, in an Unity 2Dish project, that I want to draw an hole or something similar inside a Sprite. Naturally, I want to make transparent the “drawing” of the sprite, and update dinamically its related Polygon Collider.

I have an old script which worked like that: updating the sprite to transparent via setPixel and updating the sprite texture, and updating the Polygon Collider like that:

	Destroy(GetComponent<PolygonCollider2D>());
	gameObject.AddComponent<PolygonCollider2D>();

I remember this used to work in old versions of Unity, but I tried it today on version 5.5.0f3 and the Polygon Collider simply does not update, while I can successfully make “transparent” the Sprite where I want.
How can I achieve or fix this?

The only thing I know that routinely gets messed up after a version update is public variable references (they get reset to null). Make sure the scripts in your game objects have the correct public variables (or any at all).

I doubt this is the issue but worth a shot.