spawn enemy if space is not occupied unity
var spawnPoint:Vector3 = square.position;
var hitColliders = Physics.OverlapSphere(spawnPoint, 1); //1 is purely chosen arbitrarly
if(hitColliders.Length > 0)
{
//You have something here
}
//2D
var hitColliders = Physics2D.OverlapCircleAll(spawnPoint, 0.25f);//0.25 is just a random radius the worked for me
if(hitColliders.Length > 0)
{
//You have something here
}