One script 2+ Enemies simple one

Hi i wanted to make a script that works on all enemies when the player hit one of them
it was a lot harder than i though
i want to reach at least the currentHealth on each enemy without making tons of unwanted lines
i ended up in a simple dummy script but i tried

using UnityEngine;
using System.Collections;

public class PlayerAttack : MonoBehaviour {
	public bool animation1Allowed;
	public p2Animation Player2;
	public int number;
	public GameObject enemy1;
	public GameObject enemy2;


void start()
	{

		


	}
	public void OnTriggerEnter(Collider collisionInfo) {
	
		if (collisionInfo.gameObject.CompareTag ("Enemy")) 
		{
						if (Player2.animationAttackFrame == true) {
								animation1Allowed = false;
							Player2.animationAttackFrame = false;
				number = 1;
					       damage(5);      
						}

				}

		if (collisionInfo.gameObject.CompareTag ("Enemy1")) 
		{
			if (Player2.animationAttackFrame == true) {
				animation1Allowed = false;
				Player2.animationAttackFrame = false;
				number = 1;
				damage(5);      
			}
			
		}
 }
	public void damage(int DOP)
	{
		enemy1.GetComponent<CEnemy1Ai> ().currentHealth -= DOP;

}
	public void damage1(int DOP)
	{
	
		enemy2.GetComponent<CEnemy2Ai> ().currentHealth -= DOP;
	}
}

If you are looking for a way to make all the enemies to substract some health points when something occurs (the player collides with one of them) you have a couple options.

The first one is to have a reference to all enemy objects inside an array and use that array to call your damage function. Something like:

public GameObject enemies[];

 public void OnTriggerEnter(Collider collisionInfo) {
 
        if (collisionInfo.gameObject.CompareTag ("Enemy")) 
        {
             for (int i = 0; i < enemies.Length; i++) {
                damage(enemies*, DOP);*

}
}
}
And then your damage function looks like this:
public void damage(GameObject obj, int DOP)
{
obj.GetComponent ().currentHealth -= DOP;

}
The downside of this is that you need to register all enemies whenever you create or destroy an enemy.
There is another way a bit more elegant and actually better, as it doesn’t require you to manage an enemies array, and is using events. You can have the player send an event whenever it collides with an enemy and all enemies handle that event within their own code (and substract the DOP). I recommend you to check the [Event system tutorials][1].
[1]: http://unity3d.com/learn/tutorials/modules/intermediate/scripting/events