using System.Collections;
using System.Collections.Generic;
using Tobii.EyeTracking;
using UnityEngine;
[RequireComponent(typeof(GazeAware))]
public class EnemyLight2D: BaseEnemy {

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

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

    void OnTriggerEnter2D(Collider2D col) {

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

    }


    void Melt() {
        Debug.Log("Melt");
        Health = 0;
        MusicManager.Instance.PlayOneShot(MusicManager.Instance.MapAudio(Sounds.Splat));
        Destroy(this.gameObject);
    }
}
