using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Cat : MonoBehaviour {
    [SerializeField]
    private float m_radius = 5.0f;

	// Use this for initialization
	void Start () {
		
	}

    void OnDrawGizmosSelected()
    {
        Gizmos.color = new Color(0.0f, 1.0f, 0.0f, 0.25f);
        Gizmos.DrawSphere(transform.position, m_radius);
    }

    // Update is called once per frame
    void Update () {
        var collidersInRadius = Physics2D.OverlapCircleAll(transform.position, m_radius);

        foreach (var collider in collidersInRadius)
        {
            var soundEmitter = collider.GetComponent<SoundEmitter>();
            if (soundEmitter)
            {
                soundEmitter.Reveal();
            }
        }
    }
}
