using UnityEngine;
using System.Collections;

public class TracerCollisionHandler : MonoBehaviour {

    public Object explosionPrefab;

    public void Awake() {
        if (explosionPrefab == null) {
            Debug.LogWarning("Explosion Prefab was not assigned,"
                            + " there will be no fancy explosions!", this);
        }
    }

    public void OnCollisionEnter() {
        Debug.Log("Collision detected - Tracer explodes!");
        if (explosionPrefab != null) {
            Instantiate(explosionPrefab,
                        transform.position,
                        transform.rotation);
        }
        gameObject.SetActive(false);
    }
}