はじめに
「Odin Inspector」を使用することで、
ScriptableObject をリストから作成できるエディタ拡張を実装できます
概要
例えば、Unity プロジェクトにこれらの ScriptableObject のコードが存在して
using UnityEngine; public class ItemData : ScriptableObject { public int m_id; public string m_name; }
それぞれが、こんな感じで定義されている場合に、
https://bitbucket.org/snippets/Bjarkeck/keRbr4
上記の「ScriptableObjectCreator.cs」を
Unity プロジェクトの「Editor」フォルダに導入して、
Project ビューを右クリックして「Create Scriptable Object」を選択すると、
このようなウィンドウが表示されて、
左の一覧から好きな ScriptableObject を選択して、作成できるようになります
参考ツイート
Here is a free little ScriptableObject creator utility for all of you with Odin inspector. It quickly lets search, preview and creates scriptable objects without the need for any [CreateAssetMenu] attribute. https://t.co/9BURR0DEy8 #unity3d #unitytips #gamedev @AssetStore pic.twitter.com/SRhL1DnH42
— Sirenix (@TeamSirenix) 2018年3月25日