Example #1
0
        /// <summary>
        ///     Get the nearest position that we hit. The layers
        ///     culled are the aiming layers in the camera editor
        /// </summary>
        /// <param name="distance"> The distance to check   </param>
        /// <returns>
        ///     The position of the nearest hit object straight
        ///     from the camera
        /// </returns>
        public RaycastController getNearestStraightLineTarget(float distance)
        {
            RaycastController rayController = new RaycastController(start: transform.position, direction: transform.forward, distance: distance, layerMasks: AimingLayers);

            if (drawRayCasts)
            {
                rayController.DrawRay(c: rayColor);
            }

            return(rayController);
        }