Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ClearTimeLine()
- {
- #region Clear yearsParent(container of years on the header)
- while (yearsParent.transform.childCount > 0)
- {
- if (Application.isPlaying)
- {
- Destroy(yearsParent.GetChild(0).gameObject);
- }
- else
- {
- DestroyImmediate(yearsParent.GetChild(0).gameObject);
- }
- }
- #endregion
- #region clearStreams
- int counter = transform.childCount - 1;
- while (transform.childCount > 6)
- {
- if (Application.isPlaying)
- {
- Destroy(transform.GetChild(counter).gameObject);
- }
- else
- {
- DestroyImmediate(transform.GetChild(counter).gameObject);
- }
- counter--;
- }
- #endregion
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement