言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

GameObject.GetComponentInChildren

public function GetComponentInChildren(type: Type): Component;

Parameters

type 取得するコンポーネントの型

Description

深さ優先探索でゲームオブジェクトまたはゲームオブジェクトの子たちの type からコンポーネントを取得します。

アクティブのコンポーネントのみ返します。

// Disable the spring of the first HingeJoint component
// found on any child object.

var hinge : HingeJoint;
hinge = gameObject.GetComponentInChildren(HingeJoint);
hinge.useSpring = false;
public function GetComponentInChildren(): T;

Description

ジェネリック版。詳細については Generic Functions を御覧ください