public float GetLightIntensity() { Vector2 direction = lightToReceive.transform.position - lightReceivePoint.position; //Debug.DrawRay(lightReceivePoint.position, direction, Color.green); if (!Physics2D.Raycast(lightReceivePoint.position, direction, Mathf.Infinity, layerMask) && lightToReceive.AmIInView(lightReceivePoint.position)) { return(lightToReceive.GetLightIntensity()); } else { return(0); } }