LoginSignup
11
14

More than 5 years have passed since last update.

UnityEngine.dll 内シンボルを抽出

Last updated at Posted at 2015-11-11

2015.12.16 追記

Unity 5.3.0f4 の UnityEngine.dll, UnityEditor.dll のシンボル一覧も出力して http://files.clock-up.jp/unity-index/ に反映しました。

概要

Unity で使えそうなメソッドをアタリを付けて横断的に探したいことがよくあります。
そういうときは Google 検索や公式サイト内検索を何度も繰り返すようなやり方だとけっこう時間をロスするので、あらかじめクラスとメソッドの一覧が記載されたテキストファイルを手元に持っておくとキーワード探しが捗ります。

UnityEngine.dll 内からクラス一覧とそのメンバ一覧が取得できるので、それをテキストに保存しておくと良いです。

C#による UnityEngine.dll 内シンボル一覧取得

string dll = @"C:\Program Files\Unity\Editor\Data\Managed\UnityEngine.dll";
Assembly assembly = Assembly.LoadFrom(dll);

foreach (Type type in assembly.GetTypes())
{
    Console.WriteLine(type.ToString());
    MemberInfo[] members = type.GetMembers();
    foreach (MemberInfo member in members)
    {
        Console.WriteLine("  " + member.ToString());
    }
}

結果

UnityEngine.AssetBundleCreateRequest
  …
  Boolean isDone
  Single progress
  Int32 priority
  Boolean allowSceneActivation
  …
UnityEngine.AssetBundleRequest
  UnityEngine.Object get_asset()
  UnityEngine.Object[] get_allAssets()
  Boolean get_isDone()
  Single get_progress()
  …
UnityEngine.AssetBundle
  UnityEngine.AssetBundleCreateRequest CreateFromMemory(Byte[])
  UnityEngine.AssetBundle CreateFromMemoryImmediate(Byte[])
  UnityEngine.AssetBundle CreateFromFile(System.String)
  …

こんな感じでそれっぽい情報一覧が取得できます。

取得するためのプログラム・取得したもの

※作業過程をそのまま保存してるような感じなので汚いです。
https://github.com/kobake/unity-index

整形した上でWebに配置したもの

Web閲覧用に整形したものです。gzip対応のブラウザからしか見れないはず。(サイズが大きいので生で転送するととんでもないことになる)
http://files.clock-up.jp/unity-index/
unity-index.png

11
14
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
11
14