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

public class WaredrobeBug : MonoBehaviour
{
    [SerializeField] private Sprite deadBug;
    private bool isDead;

    // Start is called before the first frame update
    void Start()
    {
        isDead = false;
    }

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

    public void OnMouseDown()
    {
        if (!isDead)
        {
            GetComponent<SpriteRenderer>().sprite = deadBug;
            GetComponent<AudioSource>().Play();
            isDead = true;
        }
    }
}
