UnityEngine.Component クラス

UnityEngine.Component クラス

[APIドキュメント]

public class Component : Object

継承:Object → Component

  • GameObject にアタッチされるすべてのコンポーネントの基底クラスです。

フィールド

gameObject

@ [APIドキュメント]

public GameObject gameObject

  • このComponentがアタッチされたGameObjectです。

transform

@ [APIドキュメント]

public Transform transform

  • このComponentがアタッチされたGameObjectのTransformです。

メソッド

GetComponent

@ [APIドキュメント]

public Component GetComponent(Type type)
public T GetComponent()
public Component GetComponent(string type)

  • アタッチされたGameObjectのコンポーネントのうち、指定する型のものを取得します。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)