TC_GroupBehaviour.cs 663 B

1234567891011121314151617181920212223242526
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. namespace TerrainComposer2
  5. {
  6. public class TC_GroupBehaviour : TC_ItemBehaviour
  7. {
  8. public int firstActive, lastActive, totalActive;
  9. public void Clear(bool undo)
  10. {
  11. int index = 0;
  12. int length = t.childCount;
  13. for (int i = 0; i < length; i++)
  14. {
  15. Transform child = t.GetChild(index);
  16. TC_ItemBehaviour item = child.GetComponent<TC_ItemBehaviour>();
  17. if (item != null) item.DestroyMe(undo);
  18. else index++;
  19. }
  20. }
  21. }
  22. }