Photon Unity Networking 2 2.45

Static Public Member Functions | Static Public Attributes | List of all members
NestedComponentUtilities Class Reference

Static Public Member Functions

static T EnsureRootComponentExists< T, NestedT > (this Transform transform)
 
static T GetParentComponent< T > (this Transform t)
 Find T on supplied transform or any parent. Unlike GetComponentInParent, GameObjects do not need to be active to be found. More...
 
static void GetNestedComponentsInParents< T > (this Transform t, List< T > list)
 Returns all T found between the child transform and its root. Order in List from child to parent, with the root/parent most being last. More...
 
static T GetNestedComponentInChildren< T, NestedT > (this Transform t, bool includeInactive)
 
static T GetNestedComponentInParent< T, NestedT > (this Transform t)
 Same as GetComponentInParent, but will always include inactive objects in search. More...
 
static T GetNestedComponentInParents< T, NestedT > (this Transform t)
 UNTESTED More...
 
static void GetNestedComponentsInParents< T, NestedT > (this Transform t, List< T > list)
 Finds components of type T on supplied transform, and every parent above that node, inclusively stopping on node StopSearchOnT component. More...
 
static List< T > GetNestedComponentsInChildren< T, NestedT > (this Transform t, List< T > list, bool includeInactive=true)
 Same as GetComponentsInChildren, but will not recurse into children with component of the DontRecurseOnT type. This allows nesting of PhotonViews/NetObjects to be respected. More...
 
static List< T > GetNestedComponentsInChildren< T > (this Transform t, List< T > list, bool includeInactive=true, params System.Type[] stopOn)
 Same as GetComponentsInChildren, but will not recurse into children with component of the DontRecurseOnT type. This allows nesting of PhotonViews/NetObjects to be respected. More...
 
static void GetNestedComponentsInChildren< T, SearchT, NestedT > (this Transform t, bool includeInactive, List< T > list)
 Same as GetComponentsInChildren, but will not recurse into children with component of the NestedT type. This allows nesting of PhotonViews/NetObjects to be respected. More...
 

Static Public Attributes

static Dictionary< System.Type, ICollection > searchLists = new Dictionary<System.Type, ICollection>()
 

Member Function Documentation

◆ GetNestedComponentInParent< T, NestedT >()

static T GetNestedComponentInParent< T, NestedT > ( this Transform  t)
static

Same as GetComponentInParent, but will always include inactive objects in search.

Template Parameters
T
DontRecurseOnT
Parameters
t
Returns
Type Constraints
T :class 
NestedT :class 

◆ GetNestedComponentInParents< T, NestedT >()

static T GetNestedComponentInParents< T, NestedT > ( this Transform  t)
static

UNTESTED

Template Parameters
T
StopSearchOnT
Parameters
t
Returns
Type Constraints
T :class 
NestedT :class 

◆ GetNestedComponentsInChildren< T >()

static List<T> GetNestedComponentsInChildren< T > ( this Transform  t,
List< T >  list,
bool  includeInactive = true,
params System.Type[]  stopOn 
)
static

Same as GetComponentsInChildren, but will not recurse into children with component of the DontRecurseOnT type. This allows nesting of PhotonViews/NetObjects to be respected.

Template Parameters
T
Parameters
t
listPass null and a reused list will be used. Consume immediately.
Type Constraints
T :class 

◆ GetNestedComponentsInChildren< T, NestedT >()

static List<T> GetNestedComponentsInChildren< T, NestedT > ( this Transform  t,
List< T >  list,
bool  includeInactive = true 
)
static

Same as GetComponentsInChildren, but will not recurse into children with component of the DontRecurseOnT type. This allows nesting of PhotonViews/NetObjects to be respected.

Template Parameters
T
Parameters
t
listPass null and a reused list will be used. Consume immediately.
Type Constraints
T :class 
NestedT :class 

◆ GetNestedComponentsInChildren< T, SearchT, NestedT >()

static void GetNestedComponentsInChildren< T, SearchT, NestedT > ( this Transform  t,
bool  includeInactive,
List< T >  list 
)
static

Same as GetComponentsInChildren, but will not recurse into children with component of the NestedT type. This allows nesting of PhotonViews/NetObjects to be respected.

Template Parameters
TCast found components to this type. Typically Component, but any other class/interface will work as long as they are assignable from SearchT.
SearchTFind components of this class or interface type.
DontRecurseOnT
Parameters
t
includeInactive
list
Returns
Type Constraints
T :class 
SearchT :class 

◆ GetNestedComponentsInParents< T >()

static void GetNestedComponentsInParents< T > ( this Transform  t,
List< T >  list 
)
static

Returns all T found between the child transform and its root. Order in List from child to parent, with the root/parent most being last.

Parameters
t
Returns
Type Constraints
T :Component 

◆ GetNestedComponentsInParents< T, NestedT >()

static void GetNestedComponentsInParents< T, NestedT > ( this Transform  t,
List< T >  list 
)
static

Finds components of type T on supplied transform, and every parent above that node, inclusively stopping on node StopSearchOnT component.

Template Parameters
T
StopSearchOnT
Parameters
t
list
Returns
Type Constraints
T :class 
NestedT :class 

◆ GetParentComponent< T >()

static T GetParentComponent< T > ( this Transform  t)
static

Find T on supplied transform or any parent. Unlike GetComponentInParent, GameObjects do not need to be active to be found.

Type Constraints
T :Component