using UnityEngine;
using System;
using System.Collections;

namespace mgaia.Utils.LayerSystem
{
	/// <summary>
	/// Representa um botao de uma layer, sensivel ao toque. Basta adicionar ao objeto da layer e adicionar os ITouchableEffects desejados.
	/// </summary>
    [RequireComponent(typeof(Collider))]
    public class ITouchable : MonoBehaviour
    {
        public void OnTouchBegan()
        {
            GetComponents<ITouchableEffects>().ForEach(effect => effect.OnTouchBegan());
        }

        public void OnTouchEnded()
        {
            GetComponents<ITouchableEffects>().ForEach(effect => effect.OnTouchEnded());
        }
    }
}