mirror of
https://github.com/ryzij/Cube-Tower-Defense.git
synced 2026-07-14 01:56:57 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
public static class ComponentHelper
|
||||
{
|
||||
public static T GetComponentInChildrenWithoutParent<T>(this Component obj) where T : Component
|
||||
{
|
||||
foreach (var comp in obj.GetComponentsInChildren<T>())
|
||||
if (comp.gameObject != obj.gameObject)
|
||||
return comp;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user