1
This commit is contained in:
@@ -17,5 +17,18 @@ namespace BITKit
|
||||
Object.Destroy(t);
|
||||
return t;
|
||||
}
|
||||
|
||||
public static int RemoveComponentsInChildren<T>(this GameObject gameObject) where T :Component
|
||||
{
|
||||
var count = 0;
|
||||
foreach (var x in gameObject.GetComponentsInChildren<T>())
|
||||
{
|
||||
if (!x) continue;
|
||||
Object.Destroy(x);
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user