As far as I know there is no built-in way of achieving this in Unity (There is also not a built-in way of detecting whether a collider is fully inside another collider or not).
If I understood you correctly your circle is going to shrink and when it reaches this point

you want to do something e.g. execute some code.
The way you could make it work for a circle and a square just based on maths would be this:
If the sides of your square are of length a
and your circle has a decreasing radius of r
, then at the moment you see in the image above the relation between the two of them is:
r = a / sqrt(2)
So you could check if (r <= a / Mathf.Sqrt(2))
in the Update
function and based on that call some function. (Maybe add another boolean to ensure the function only gets called once.)
You can get your sprite widths using
width = GetComponent<SpriteRenderer>().bounds.size.x;
The radius of your circle would then obviously be half the width of the circle sprite.
You should probably also store the SpriteRenderer
in a variable once instead of calling GetComponent
on every frame.
For an equilateral triangle the equation would be
r = a / sqrt(3)
where a
is the length of the triangle's side.