using System.Collections;
using System.Collections.Generic;
using Tobii.EyeTracking;
using UnityEngine;


[RequireComponent(typeof(GazeAware))]
public class ElectricEnemy2D : BaseEnemy {

    void Awake() {
        base.Start();
    }
    private GazeAware _gazeAware;

    public override void Start() {
        Type = AbilityType.Electricity;
        _gazeAware = GetComponent<GazeAware>();
        health = 5;
    }

    void OnTriggerEnter2D(Collider2D col) {

        var hitBullet = col.transform.GetComponent<Bullet>();
        if(hitBullet) {
            if(hitBullet.Type.Equals(Type)) {
                Explode();
            }
        }

    }

    void Explode() {
        Debug.Log("death");
        Health = 0;
        MusicManager.Instance.PlayOneShot(MusicManager.Instance.MapAudio(Sounds.RobotDie));
        Destroy(this.gameObject);

    }
}
