using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Ground : MonoBehaviour {
    
    public List<GroundEnemie> enemies;

    private void OnCollisionEnter2D(Collision2D collision)
    {
        Player p = collision.gameObject.GetComponent<Player>();
        if(p != null)
        {
            foreach (GroundEnemie e in enemies)
                e.movSpeed = e.chasingSpeed;
        }
    }

    private void OnCollisionExit2D(Collision2D collision)
    {
        Player p = collision.gameObject.GetComponent<Player>();
        if (p != null)
        {
            foreach (GroundEnemie e in enemies)
                e.movSpeed = e.normalSpeed;
        }
    }
}
