using UnityEngine;
using System.Collections;
using Framework.Entities;
using Framework.Extensions;
using System.Linq;
using System.Collections.Generic;
using Framework.InteractionSystem;
using Framework.Utility;
using Project.Actors;

namespace Project.Constructs
{
    public class BarrierBehaviour : CoreBehaviour
    {
        private int enemyCount;
        public int enemyTargetCount = 0;

        // Use this for initialization
        protected override void InnerAwake()
        {

        }

        // Update is called once per frame
        protected override void InnerUpdate()
        {
            this.enemyCount = GameObject.FindObjectsOfType<BasicEnemySensor>().Length;
            if (this.enemyCount <= this.enemyTargetCount)
            {
                Destroy(this.gameObject);
            }
        }
    }
}