[Unity game development] commonly used class of Component class

gameObject additional components of game objects. Components are always attached to game objects.

transform objects attached to this game Transform components (blank if none).

This game tag label object.

collider object attached to this game Collider (if no additional null).

renderer Renderer component objects attached to this game (blank if none).

rigidbody attached to this game object Rigidbody components (blank if none).

GetComponent If the game object has additional type type of component is returned, if not null.

GetComponentInChildren return on this type of game object type components or any of its sub-objects, using depth first search.

GetComponents returns all the components of this type of an object type.

GetComponentsInChildren return this object and its sub-objects game type all types of components

Guess you like

Origin blog.csdn.net/Alina_catty/article/details/79377458