Forge/Integration/BaseContainer.cs
/// <summary>
/// Destroys any entity containers that still exist.
/// </summary>
Destroys any entity containers that still exist.
Destroys any entity containers that still exist .
public static void ClearContainers(GameObject root) {
            List<GameObject> toDestroy = new List<GameObject>();
            foreach (Transform child in root.transform) {
                if (child.GetComponent<TDerived>() != null) {
                    toDestroy.Add(child.gameObject);
                }
                else {
                    ClearContainers(child.gameObject);
                }
            }
            foreach (GameObject child in toDestroy) {
                DestroyImmediate(child);
            }
        }
public static void ClearContainers ( GameObject root ) { List < GameObject > toDestroy = new List < GameObject > ( ) ; foreach ( Transform child in root . transform ) { if ( child . GetComponent < TDerived > ( ) != null ) { toDestroy . Add ( child . gameObject ) ; } else { ClearContainers ( child . gameObject ) ; } } foreach ( GameObject child in toDestroy ) { DestroyImmediate ( child ) ; } }
Destroys any entity containers that still exist.
Destroys any entity containers that still exist .
root
GameObject