public LightNode MarchLightTree(LightSource source, Dictionary <PlayObject, List <LightBeam> > collisions, int maxDepth) { LightNode root = new LightNode { Object = source, Position = WorldPositionToGrid(source.transform.position), LightBeams = source.ComputeOutgoingLightBeams(null) }; foreach (LightBeam lightBeam in root.LightBeams) { root.LightNodes.Add(March(root.Position, lightBeam, collisions, maxDepth)); } return(root); }