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

スクリプト言語

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

GameObject.GetComponents

public function GetComponents(type: Type): Component[];

Parameters

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

Description

ゲームオブジェクトの type の全てのコンポーネントを返します

	// Disable the spring on all HingeJoints 
	// in this game object

	var hingeJoints : HingeJoint[];
	hingeJoints = gameObject.GetComponents.<HingeJoint>();
	for (var joint : HingeJoint in hingeJoints) {
		joint.useSpring = false;
	}
public function GetComponents(): T[];

Description

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