けいごのなんとか

Unityユーザーとしてのブログ。ギリギリ路線走ってます。

EditorWindowのタイトルにアイコンをつける

f:id:anchan828:20130827033629p:plain

ここの文字って「Unity.app/Contents/Resources/UI_Strings_EN.txt」で取得しているのはわかっていたのですがアイコンをどうやって設定しているのかがわかりませんでした

EditorGUIUtility.TextContentで取得できる

GUILayout.Label(typeof(EditorGUIUtility).GetMethod("TextContent", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, new object[] { "UnityEditor.InspectorWindow" }) as GUIContent);

f:id:anchan828:20130827033814p:plain

アイコンの設定の仕方

f:id:anchan828:20130827033938p:plain

「Editor Default Resources/Icons/(ウィンドウ名).png」または「Editor Default Resources/Icons/d_(ウィンドウ名).png」で保存する

f:id:anchan828:20130827034012p:plain

これで独自のWindowにアイコンつけれるねー

でかい画像を使ったから潰れちゃった

追記

更に詳しい情報を書いてくれています!

EidtorWindowのタイトルに好きなアイコンを付けてみた - 青空の月