C# Class UnityQuery.Hierarchy

显示文件 Open project: npruehs/unity-query

Public Methods

Method Description
GetAncestors ( this gameObject ) : IEnumerable

Selects all ancestors (parent, grandparent, etc.) of a game object.

GetAncestorsAndSelf ( this gameObject ) : IEnumerable

Selects all ancestors (parent, grandparent, etc.) of a game object, and the game object itself.

GetChildren ( this gameObject ) : IEnumerable

Selects all children of a game object.

GetDescendants ( this gameObject ) : IEnumerable

Selects all descendants (children, grandchildren, etc.) of a game object.

GetDescendantsAndSelf ( this gameObject ) : IEnumerable

Selects all descendants (children, grandchildren, etc.) of a game object, and the game object itself.

GetRoot ( this gameObject ) : GameObject

Gets the hierarchy root of the game object.

IsAncestorOf ( this gameObject, GameObject descendant ) : bool

Indicates whether the a game object is an ancestor of another one.

IsDescendantOf ( this gameObject, GameObject ancestor ) : bool

Indicates whether the a game object is a descendant of another one.

OnLayer ( this gameObjects, int layer ) : IEnumerable

Filters a sequence of game objects by layer.

OnLayer ( this gameObjects, string layerName ) : IEnumerable

Filters a sequence of game objects by layer.

WithTag ( this gameObjects, string tag ) : IEnumerable

Filters a sequence of game objects by tag.

Method Details

GetAncestors() public static method

Selects all ancestors (parent, grandparent, etc.) of a game object.
public static GetAncestors ( this gameObject ) : IEnumerable
gameObject this Game object to select the ancestors of.
return IEnumerable

GetAncestorsAndSelf() public static method

Selects all ancestors (parent, grandparent, etc.) of a game object, and the game object itself.
public static GetAncestorsAndSelf ( this gameObject ) : IEnumerable
gameObject this Game object to select the ancestors of.
return IEnumerable

GetChildren() public static method

Selects all children of a game object.
public static GetChildren ( this gameObject ) : IEnumerable
gameObject this Game object to select the children of.
return IEnumerable

GetDescendants() public static method

Selects all descendants (children, grandchildren, etc.) of a game object.
public static GetDescendants ( this gameObject ) : IEnumerable
gameObject this Game object to select the descendants of.
return IEnumerable

GetDescendantsAndSelf() public static method

Selects all descendants (children, grandchildren, etc.) of a game object, and the game object itself.
public static GetDescendantsAndSelf ( this gameObject ) : IEnumerable
gameObject this Game object to select the descendants of.
return IEnumerable

GetRoot() public static method

Gets the hierarchy root of the game object.
public static GetRoot ( this gameObject ) : GameObject
gameObject this Game object to get the root of.
return UnityEngine.GameObject

IsAncestorOf() public static method

Indicates whether the a game object is an ancestor of another one.
public static IsAncestorOf ( this gameObject, GameObject descendant ) : bool
gameObject this Possible ancestor.
descendant UnityEngine.GameObject Possible descendant.
return bool

IsDescendantOf() public static method

Indicates whether the a game object is a descendant of another one.
public static IsDescendantOf ( this gameObject, GameObject ancestor ) : bool
gameObject this Possible descendant.
ancestor UnityEngine.GameObject Possible ancestor.
return bool

OnLayer() public static method

Filters a sequence of game objects by layer.
public static OnLayer ( this gameObjects, int layer ) : IEnumerable
gameObjects this Game objects to filter.
layer int Layer to get the game objects of.
return IEnumerable

OnLayer() public static method

Filters a sequence of game objects by layer.
public static OnLayer ( this gameObjects, string layerName ) : IEnumerable
gameObjects this Game objects to filter.
layerName string Layer to get the game objects of.
return IEnumerable

WithTag() public static method

Filters a sequence of game objects by tag.
public static WithTag ( this gameObjects, string tag ) : IEnumerable
gameObjects this Game objects to filter.
tag string Tag to get the game objects of.
return IEnumerable