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

public class EndSpot : MonoBehaviour
{
    [SerializeField] LayerMask m_mask;
    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public bool CheckEndSpot()
    {
        Collider[] colls = Physics.OverlapBox(transform.position, transform.localScale *0.4f, Quaternion.identity, m_mask);

        //Debug.Log("colliders: " + colls.Length);

        return colls.Length == 2;
    }

    private void OnDrawGizmos()
    {
        Gizmos.color = Color.magenta;

        Gizmos.DrawWireCube(transform.position, transform.localScale * 0.8f);
    }
}
