UnityEssentials
Small but useful tools and features for Unity
Static Public Member Functions | List of all members
UnityEngine.GameObjectExtensions Class Reference

Extensions for GameObject More...

Collaboration diagram for UnityEngine.GameObjectExtensions:
Collaboration graph

Static Public Member Functions

static T GetComponentRequired< T > (this GameObject self)
 Get a component. Log an error if it is not found. More...
 
static void SetLayerRecursively (this GameObject self, int newLayer)
 

Detailed Description

Extensions for GameObject

Definition at line 6 of file GameObjectExtensions.cs.

Member Function Documentation

◆ GetComponentRequired< T >()

static T UnityEngine.GameObjectExtensions.GetComponentRequired< T > ( this GameObject  self)
static

Get a component. Log an error if it is not found.

Template Parameters
TThe type of component to get.
Returns
The component, if found.
Type Constraints
T :Component 

Definition at line 13 of file GameObjectExtensions.cs.

◆ SetLayerRecursively()

static void UnityEngine.GameObjectExtensions.SetLayerRecursively ( this GameObject  self,
int  newLayer 
)
static

Definition at line 22 of file GameObjectExtensions.cs.


The documentation for this class was generated from the following file: