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

    [SerializeField]
    float speed = 10f;

    void Awake() {
        base.Start();
        _gazeAware = GetComponent<GazeAware>();
    }

    public override void Start() {
        Type = AbilityType.Sound;
    }


    void OnTriggerEnter2D(Collider2D col) {

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

    }
    void Shatter() {
        MusicManager.Instance.PlayOneShot(MusicManager.Instance.MapAudio(Sounds.LargeShatter));
        Destroy(this.gameObject);
    }

}
