How to avoid one Collision when object collide between two collision Object

Hi,

I have four cubes which are close to each other. when my ball hit between two cube. OncollisionEnter Function detect twice at the same time and my score increase twice in single hit.
all cubes are tag with same name.

How to solve this issue?

void OnCollisionEnter(Collision collisionObject)

	{

	
	if(collisionObject.gameObject.tag == "Cube" )

		
	{
		

		string points = collisionObject.gameObject.name;

		
		switch(points)
		{

			case "Cube1":
			gameDataRef.score += 100;
			break;

			
			case "Cube2":
			gameDataRef.score += 50;
			break;
				
			case "Cube3":
			gameDataRef.score += 60;
			break;
				
				
			case "Cube4":
			gameDataRef.HitScore += 80;
			break;
		}
	}

}

you can set a Boolean value for collision

bool hitCube = false

void OnCollisionEnter(Collision collisionObject)
{

if(!hitCube) //pointless checking this if we already hit one
 {
 if (collisionObject.gameObject.tag == "cube")
  {
  //do your switch(points) stuff here

  hitCube = true;
  }
 }
}

void OnCollisionExit(Collision collisionObject)
{
if(hitCube&&collisionObject.gameObject.tag == "cube")
 {
 hitCube = false;
 }
}