using UnityEngine;
using System.Collections;

public class Bottle : MonoBehaviour
{
    [SerializeField]
    private LayerMask _collisionMask;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update ()
    {
	
	}

    void FixedUpdate()
    {

    }

    public void OnCollisionEnter2D(Collision2D collision)
    {
        int layerMask = 1 << collision.gameObject.layer;
        if ((layerMask & _collisionMask) != 0)
        {
            //Debug.LogFormat("Bottle collision with {0}\n", collision.gameObject.name);
            SendMessage("Explode");
        }
    }
}
