Advertisement
Guest User

Automatic score text collecting LINQ

a guest
Nov 29th, 2015
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.29 KB | None | 0 0
  1. foreach(var scores in transform.Cast<Transform>()
  2.     .Select(child => child.GetComponentsInChildren<Text>())
  3.     .Select(scores =>
  4.         new { frame = scores.Last(), bowls = scores.Where(obj => obj != scores.Last()) }
  5.         ))
  6. {
  7.     bowlScores.AddRange(scores.bowls);
  8.     frameScores.Add(scores.frame);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement