Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. public void ClearTimeLine()
  2. {
  3. #region Clear yearsParent(container of years on the header)
  4.  
  5. while (yearsParent.transform.childCount > 0)
  6. {
  7. if (Application.isPlaying)
  8. {
  9. Destroy(yearsParent.GetChild(0).gameObject);
  10. }
  11. else
  12. {
  13. DestroyImmediate(yearsParent.GetChild(0).gameObject);
  14. }
  15.  
  16. }
  17.  
  18. #endregion
  19. #region clearStreams
  20. int counter = transform.childCount - 1;
  21. while (transform.childCount > 6)
  22. {
  23.  
  24. if (Application.isPlaying)
  25. {
  26. Destroy(transform.GetChild(counter).gameObject);
  27. }
  28. else
  29. {
  30. DestroyImmediate(transform.GetChild(counter).gameObject);
  31. }
  32. counter--;
  33. }
  34.  
  35. #endregion
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement