Language
Edit

GameObjectExtensions Class

Definition

Extension methods for Unity's GameObject class

public static class GameObjectExtensions
type GameObjectExtensions = class
Public Module GameObjectExtensions
Inheritance
GameObjectExtensions

Methods

Name Description
ApplyToHierarchy(GameObject, Action<GameObject>)

Apply the specified delegate to all objects in the hierarchy under a specified game object.

FindAncestorComponent<T>(GameObject, Boolean)

Find the first component of type T in the ancestors of the specified game object.

ForEachComponent<T>(GameObject, Action<T>)

Perform an action on every component of type T that is on this GameObject

IsComponentRequired<T>(GameObject, List<Type>)

Checks if any MonoBehaviour on the given GameObject is using the RequireComponentAttribute requiring type T

IsInLayerMask(GameObject, LayerMask)

Determines whether or not a game object's layer is included in the specified layer mask.

SetChildrenActive(GameObject, Boolean)

Set all GameObject children active or inactive based on argument

Applies to