i use this a lot for debugging collision-related code like reflexions, sliding and ray castings, simple but useful to catch events that happen in a glimpse
IEnumerator DrawRayTimed (Vector3 origin, Vector3 direction, Color color, float duration) {
do {
duration -= Time.deltaTime;
Debug.DrawRay (origin, direction, color);
yield return 0;
}
while (duration > 0);
}