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

public class ShowerScript : MonoBehaviour
{
    public string myLayer;
    LayerMask myLay;
    public float myRadius;

    public void Awake()
    {
        myLay = 1 << LayerMask.NameToLayer(myLayer);
        //print(myLay);
    }

    public void FixedUpdate()
    {
        Collider2D[] colls = Physics2D.OverlapCircleAll(transform.position, myRadius, myLay);
        foreach (Collider2D col in colls)
        {
            InformShow iss = null;
            if (col.transform.parent != null && col.transform.parent.childCount > 0)
                 iss = col.transform.parent.GetChild(0).GetComponent<InformShow>();
            if (iss != null) iss.Show();
        }
        
        transform.GetChild(0).transform.localScale = new Vector3(myRadius*2/5.0f, myRadius*2/5.0f, 1);
    }

    public void GrowCircle()
    {
        
        myRadius *= 1.15f;
    }

}
