LoginSignup
0
0

More than 1 year has passed since last update.

【Unity】FindObjectOfTypeで指定したクラスを取得する

Posted at

FindObjectOfTypeとは

特定のクラスが存在するオブジェクトを、すべて取得して、配列に入れる仕組みを作る。
オブジェクトを複製して、すべてに同じスクリプトを追加するううことが出来る。

全てのコンポーネントの中からスプリクトを探すため重い処理となっている。乱用注意。

基本構文

  変数 = 実装されているクラスのスクリプト名.FindObjectOfType<探すもののスクリプト名>();

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0