Version: 2017.1
public static Object[] FindObjectsOfType (Type type);

パラメーター

type 見つけるオブジェクトの型

戻り値

Object[] 指定した型で見つかったオブジェクトの配列を返します。

説明

タイプから見つけたすべてのアクティブのオブジェクト配列を返します

アセット(メッシュ、テクスチャ、プレハブなど)や非アクティブのオブジェクトは取得できません。

Please note that this function is very slow. It is not recommended to use this function every frame. In most cases you can use the singleton pattern instead.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnMouseDown() { HingeJoint[] hinges = FindObjectsOfType(typeof(HingeJoint)) as HingeJoint[]; foreach (HingeJoint hinge in hinges) { hinge.useSpring = false; } } }