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

public class Attack_Polygon_Master : MonoBehaviour {

    public Turret_Master turretAI;

    public bool isLeft = false;

    void Awake()
    {
        turretAI = gameObject.GetComponentInParent<Turret_Master>();
    }

    void OnTriggerStay2D(Collider2D col)
    {
        if (col.CompareTag("Player"))
        {
            if (isLeft)
            {
                turretAI.Attack(false);
            }
            else
            {
                turretAI.Attack(true);
            }
        }
    }


}
