Unity Editor拡張で単純に画像を表示させたかったのですが、調べてもあまり出てこなかったのでメモです。ボタンに表示、Inspectorに表示は出てきますがなぜか出てこない。
下のサンプルではAssets/test.pngを読み込みそれをGUI.DrawTextureしています。
|
1 2 |
Texture2D texture = AssetDatabase.LoadMainAssetAtPath("Assets/test.png") as Texture2D; GUI.DrawTexture(new Rect(0, 0, 32, 32), texture, ScaleMode.StretchToFill); |





![Unity – 容量削減作業に便利なツール [win]](https://i0.wp.com/mizutanikirin.net/blog/wp-content/uploads/2015/09/tool1-150x150.jpg?resize=150%2C150&ssl=1)

コメントを残す