Version: 5.4

Component.GetComponentInParent

Switch to Manual
public Component GetComponentInParent (Type t);

Parameters

t @param type Тип возвращаемого компонента.

Returns

Component A component of the matching type, if found.

Description

Возвращает компонент типа type в GameObject или любого из его родителей.

Recurses upwards until it finds a valid component. Returns null if no component found. Only components on active GameObjects are returned.


public T GetComponentInParent ();

Returns

T A component of the matching type, if found.

Description

Дженерик функции. Для получения дополнительной информации смотрите страницу, посвященную Дженерик функциям.

Recurses upwards till it finds a valid component. Returns null if no component found. Only component on active Game Objects are returned.