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

public class EnemyDeathManager : MonoBehaviour
{

    public AudioSource deathSound;

    // Start is called before the first frame update
    void Start()
    {
        deathSound = gameObject.GetComponent<AudioSource>();
    }

    // Update is called once per frame
    void Update()
    {

    }
    public GameObject Dead;
    public GameObject Drone;
    public int Points;
    public void Die()
    {
        deathSound.Play();
        FindObjectOfType<GM>().points += Points;
        if (Dead != null)
            Instantiate(Dead, transform.position, Quaternion.identity);
        if (Drone != null)
            Instantiate(Drone, transform.position, Quaternion.identity);
        Destroy(gameObject);
    }
}
