void ProcessHit(PH_DamageDealer damageDealer)
 {
     health -= damageDealer.GetDamage(); //take damage
     damageDealer.Hit();                 //will destroy the foreign game object
     if (health <= 0)
     {
         Die();
     }
 }
    void OnTriggerEnter2D(Collider2D other)//when it's touched by other script
    {
        PH_DamageDealer damageDealer = other.gameObject.GetComponent <PH_DamageDealer>();

        if (!damageDealer)
        {
            return;
        }                             //if it doesn't have a damage dealer component, just cut it there
        ProcessHit(damageDealer);
    }
    void OnTriggerEnter2D(Collider2D other)
    {
        PH_DamageDealer damageDealer = other.GetComponent <PH_DamageDealer>();//get the script from the object

        if (!damageDealer)
        {
            return;
        }                         //if there's nothing, just move on
        ProcessHit(damageDealer); // use the script
    }
    void ProcessHit(PH_DamageDealer damageDealer)
    {
        health -= damageDealer.GetDamage();//lower health by the amount from the damage dealer script
        damageDealer.Hit();
        if (health <= 0)
        {
            Die();
        }                                                     //if health reahed zero, die

        else if (health <= HealthFormChange && formIndex < 1) //or if health reached the critical point and enemy didn't change form yet
        {
            formIndex++; ChangeForm();
        }                             //ChangeForm form and increase formIndex
    }