Vector2 offset = new Vector2(
gameObject.spriteRenderer.spriteRegion.getRegionWidth()/2,
gameObject.spriteRenderer.spriteRegion.getRegionHeight()/2);
BoxCollider coll = new BoxCollider(
new Vector2(gameObject.spriteRenderer.spriteRegion.getRegionWidth()/2, gameObject.spriteRenderer.spriteRegion.getRegionHeight()/2)
, offset);
gameObject.AddComponent(coll);