how to break a loop twice?

my question may sound pretty noobie, but how do i break a loop with 2 if statements and break it twice?
i’m using down blow script for shooting raycast bullets.and it helps my raycast bullets to collide with different layers like wood stone or brick game objects.i also use it to pass through certain layers like glass and hit the solid layer behind it.and it works fine, but the bullets only pass through one layer i want to pass through 2 layers or more than that ,and then stop at solid layers like wood or stone. right now the raycast pass through glass layers and stops at layers like stone or wood,how do i make it so it pass through glass and enemy flesh at the same time?

void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {




	}
		public void Shoot ()
		{

		RaycastHit[] hits = Physics.RaycastAll (transform.position, transform.forward, range, requiredLayers).ToList ().OrderBy (h => h.distance).ToArray ();

		for (int i = 0; i < hits.Length; i++) {
			RaycastHit hit = hits *;*
  •  	int layer = hit.collider.gameObject.layer;*
    
  •  	if (layer == LayerMask.NameToLayer ("glass")) {*
    
  •  		bulletCollisionMadule.enabled = false;*
    
  •  		targetForGun targeti = hit.transform.GetComponent<targetForGun> ();*
    
  •  		if (hit.rigidbody != null) {*
    

_ hit.rigidbody.AddForce (-hit.normal * BulletImpactForce);_

  •  		}*
    
  •  		if (targeti != null) {*
    
  •  			targeti.takedamge (damage);*
    
  •  		}*
    
  •  		GameObject glasshit = Instantiate (glassHitImpact, hit.point, Quaternion.LookRotation (hit.normal));*
    
  •  		glasshit.transform.parent = hit.transform;*
    
  •  		Destroy (glasshit, 6f);*
    
  •  		GameObject glasssound = Instantiate (glassHitSound, hit.point, Quaternion.LookRotation (hit.normal));*
    
  •  		glasshit.transform.parent = hit.transform;*
    
  •  		Destroy (glasssound, 6f);*
    
  •  	}*
    
  •  	else if (layer == LayerMask.NameToLayer ("body")) {*
    
  •  		var broadcaster = hit.collider.attachedRigidbody.GetComponent<MuscleCollisionBroadcaster> ();*
    
  •  		if (broadcaster != null) {*
    

_ broadcaster.Hit (unpin, -hit.normal * BulletForeceForRagdoll, hit.point);_

  •  			GameObject impatbullett = Instantiate (blood, hit.point, Quaternion.LookRotation (hit.normal));*
    
  •  			impatbullett.transform.parent = hit.transform;*
    
  •  			Destroy (impatbullett, 6f);*
    
  •  			GameObject bloodsound = Instantiate (bloodSound, hit.point, Quaternion.LookRotation (hit.normal));*
    
  •  			bloodsound.transform.parent = hit.transform;*
    
  •  			Destroy (bloodsound, 6f);*
    
  •  			EnemyFootHands enemyfoothands = hit.transform.GetComponent<EnemyFootHands> ();*
    
  •  			enemyChest enemychest = hit.transform.GetComponent<enemyChest> ();*
    
  •  			EnemyHead enemyhead = hit.transform.GetComponent<EnemyHead> ();*
    
  •  			enemyLeftFoot enemyleftfoot = hit.transform.GetComponent<enemyLeftFoot> ();*
    
  •  			enemyRightFoot enemyightfoot = hit.transform.GetComponent<enemyRightFoot> ();*
    
  •  			if (enemychest != null) {* 
    
  •  				enemychest.takedamge (damage);*
    
  •  			}*
    
  •  			if (enemyhead != null) {*
    
  •  				enemyhead.takedamgei (damage);*
    
  •  			}*
    
  •  			if (enemyfoothands != null) {*
    
  •  				enemyfoothands.takedamgei (damage);*
    
  •  			}*
    
  •  			if (enemyleftfoot != null) {*
    
  •  				enemyleftfoot.takedamgei (damage);*
    
  •  			}*
    
  •  			if (enemyightfoot != null) {*
    
  •  				enemyightfoot.takedamgei (damage);*
    
  •  			}*
    
  •  		}*
    
  •  		else {	*
    
  •  			bulletCollisionMadule.enabled = true;*
    

_ LayerFunction (hits );_
* break;*
* }*

* }*
* }*
* }*

* void LayerFunction (RaycastHit hit)*
* {*

* if (hit.collider.gameObject.layer == LayerMask.NameToLayer (“stone”)) {*

* targetForGun targeti = hit.transform.GetComponent ();*

* if (hit.rigidbody != null) {*

_ hit.rigidbody.AddForce (-hit.normal * BulletImpactForce);_

* }*

* if (targeti != null) {*

* targeti.takedamge (damage);*

* }*

* GameObject impatbullet = Instantiate (stoneHitImpact, hit.point, Quaternion.LookRotation (hit.normal));*

* impatbullet.transform.parent = hit.transform;*

* Destroy (impatbullet, 6f);*

* GameObject stonesound = Instantiate (stoneHitSound, hit.point, Quaternion.LookRotation (hit.normal));*

* stonesound.transform.parent = hit.transform;*

* Destroy (stonesound, 6f);*

* }*

* }*

}

I think you want something like this:

int layer = hit.collider.gameObject.layer;
if (layer == LayerMask.NameToLayer ("glass"))
{
    hitglass();
}
else if (layer == LayerMask.NameToLayer ("body"))
{
    hitbody();
}
else
{
    LayerFunction (hits *);*

break;
}