using UnityEngine;

public class MissTrigger : MonoBehaviour
{
    public GameScript GameObjectScript;
    private Collider2D collisionObject;
    public GameObject ExplosionParticleSystem;

    void OnTriggerEnter2D (Collider2D col)
    {
        collisionObject = col;
        GameObjectScript.FailCount++;
        col.gameObject.GetComponent<Rigidbody2D>().isKinematic = true;
        col.gameObject.GetComponent<SpriteRenderer>().enabled = false;
        col.enabled = false;

        var tr = col.gameObject.transform;

        var explosion = Instantiate(ExplosionParticleSystem, tr.position, Quaternion.identity) as GameObject;
        GameObjectScript.PlaySound("XPL");
    }
}