기술 자료

Unity Engine

Unity Engine

GetComponentIndex(Component)

Retrieves the index of the specified component in the array of components attached to the GameObject.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public int GetComponentIndex(Component component)

Parameters

component

The component to search for.

Returns

Type

Description

intThe index of the specified Component if it exists. Otherwise, returns
-1
.