LoginSignup
0
0

More than 3 years have passed since last update.

UIElementsとOdinEditorWindowをあわせてみる

Posted at

いやはや、UIElementsを使っているのですけどね
資料もないし大変ですね・・・

なんだろう結構複雑なEditor拡張を作るのにはまあIMGUIより向いているというのはまあ、そのとおりだと思うのですけど
「これからはこれを使ってエディタ拡張を書いていこう!」になるには結構時間がかかりそうな印象です。

一方Odinという拡張があります
https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041?aid=1101lGoY&utm_source=aff

これはIMGUI(OnGUI)を書かずにアトリビュートだけで色々エディタ拡張を出来るようにしようとしているアセットです
控えめに言ってちょーべんり
Odinは良いぞ!

さて、OdinにはOdinEditorWindowっていう便利な機能があるのですが、
要はEditorWindowの見た目をアトリビュートと変数だけで作ってしまえるというイケてる機能です

でもOdinもUIElementsとかで作るような凝ったものを作るのには向いていないのです。

そんなわけでその2つを組み合わせる方法をここにぺたりとおいておきます

        //DefaultInspectorを追加
        VisualElement root = rootVisualElement;
        root.Add(new IMGUIContainer(() => base.OnGUI()));

以上

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