using UnityEngine;
using System.Collections;

public class Button : MonoBehaviour
{
    public bool buttonActive;
    Animator buttonAnimator;

	// Use this for initialization
	void Start ()
    {
        buttonActive = false;
        buttonAnimator = GetComponent<Animator>();
    }
	
	// Update is called once per frame
	void Update ()
    {
        
	}

    void OnTriggerStay2D (Collider2D other)
    {
        if (other.gameObject.layer == 11)
        {
            buttonActive = true;
            buttonAnimator.SetBool("buttonActive", true);
        }
    }

    void OnTriggerExit2D(Collider2D other)
    {
        if (other.gameObject.layer == 11)
        {
            buttonActive = false;
            buttonAnimator.SetBool("buttonActive", false);
        }
    }
}
