diff --git a/Assets/Src/Library/Runtime/Extensions/Transform.meta b/Assets/Src/Library/Runtime/Extensions/Transform.meta new file mode 100644 index 0000000..fde0456 --- /dev/null +++ b/Assets/Src/Library/Runtime/Extensions/Transform.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: be707065ac7fc4fd5a4aa1deedf1fce1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Src/Library/Runtime/Extensions/Transform/Utils.cs b/Assets/Src/Library/Runtime/Extensions/Transform/Utils.cs new file mode 100644 index 0000000..74cb323 --- /dev/null +++ b/Assets/Src/Library/Runtime/Extensions/Transform/Utils.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +namespace CodeBlaze.Library.Extensions +{ + public static class Utils + { + /// + /// Destroy all children of transform + /// + /// + /// + public static Transform Clear(this Transform transform) + { + foreach (Transform child in transform) + { + Object.Destroy(child.gameObject); + } + + return transform; + } + } +} \ No newline at end of file diff --git a/Assets/Src/Library/Runtime/Extensions/Transform/Utils.cs.meta b/Assets/Src/Library/Runtime/Extensions/Transform/Utils.cs.meta new file mode 100644 index 0000000..61de30a --- /dev/null +++ b/Assets/Src/Library/Runtime/Extensions/Transform/Utils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7a3655dcfaa744d7a2ccd2683cab82bd +timeCreated: 1606487182 \ No newline at end of file