拡張エディタやImporterの設定ファイルとして、ScriptableObjectが使用できる。 tsubakit1.hateblo.jp 例えば今回は、画像ファイルをUnity上にインポートする際に、特定のフォルダ配下の場合はTrue color にしたりmip mapをOFFにするといった自動設定を行うため、下記のようなScriptableObjectを用意する。 [CreateAssetMenu(fileName = "TextureImporterConfig")] public class TextureImporterConfig : ScriptableObject, ISerializationCallbackReceiver { public List<TextureSetting> textureSettings = new List<TextureSetting>
Unity 4.5から標準PropertyDrawerとしてHeaderとSpaceが追加されてました。 使い方 Headerは、Inspectorにヘッダーを追加します。このHeaderを追加するには、変数の前に以下のように記述します。 [Header("ヘッダー名")] public int hp; Spaceはインスペクターに表示するパラメータ間にスペース(空間)を追加します。こちらは、変数の前に 以下のように記述します。 [Space(幅)] public int hp; どちらも手軽にInspectorを整形出来る為、スクリプトを作成する際は有効な助けになりそうです。 ヘッダー・スペースのテスト 注意点 なお、複数の変数を同時に定義するケースでは、注意が必要です。 例えば以下のようなコードだと、複数の変数に同じヘッダーが付与される事になります。 [Header("State")]
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く