コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【Unity】【Odin - Inspector and Serializer】インデントを設定できる「Indent」属性

目次 「Indent」属性 「Indent」属性を使用すると 変数やプロパティのインデントを設定できます using Sirenix.OdinInspector; using UnityEngine; public class Example : MonoBehaviour { [Indent] public int i1; [Indent( 2 )] public int i2; [Indent( …

【Unity】【Odin - Inspector and Serializer】詳細な説明文付きでインフォメーションを表示する「DetailedInfoBox」属性

目次 「DetailedInfoBox」属性 「DetailedInfoBox」属性を使用すると Inspector に詳細な説明文付きインフォメーションを表示できます 説明文はクリックで開閉可能です using Sirenix.OdinInspector; using UnityEngine; public class Example : MonoBehavio…

【Unity】【Odin - Inspector and Serializer】インフォメーションを表示する「InfoBox」属性

目次 「InfoBox」属性 「InfoBox」属性を使用すると Inspector にインフォメーションを表示できます using Sirenix.OdinInspector; using UnityEngine; public class Example : MonoBehaviour { [InfoBox( "ピカチュウ" )] public int a1; [InfoBox( "カイリ…

【Unity】【Odin - Inspector and Serializer】ゲームを実行しているかどうかで項目を編集できるようにする「DisableInPlayMode」「DisableInEditorMode」属性

目次 「DisableInPlayMode」「DisableInEditorMode」属性 「DisableInPlayMode」属性を使用すると ゲームを実行している間は値が変更できないようになります 「DisableInEditorMode」属性を使用すると ゲームを実行していない時は値が変更できないようになり…

【Unity】【Odin - Inspector and Serializer】条件を満たしているかどうかで項目を表示するかどうかを変更できる「ShowIf」「HideIf」属性

目次 「ShowIf」「HideIf」属性 「ShowIf」属性を使用すると 条件を満たしている場合に変数やプロパティが表示されるようになります 「HideIf」属性を使用すると 条件を満たしている場合に変数やプロパティが非表示になります using Sirenix.OdinInspector; …

【Unity】【Odin - Inspector and Serializer】条件を満たしているかどうかで項目を編集できるようにする「EnableIf」「DisableIf」属性

目次 「EnableIf」「DisableIf」属性 「EnableIf」属性を使用すると 条件を満たしている場合にのみ変数やプロパティが編集可能になります 「DisableIf」属性を使用すると 条件を満たしていない場合にのみ変数やプロパティが編集可能になります using Sirenix…

【Unity】【Odin - Inspector and Serializer】変数ごとのコンテキストメニューを無効化する「DisableContextMenu」属性

目次 「DisableContextMenu」属性 「DisableContextMenu」属性を使用すると 変数を右クリックしても コンテキストメニューが表示されなくなります using Sirenix.OdinInspector; using UnityEngine; public class Example : MonoBehaviour { [DisableContext…

【Unity】【Odin - Inspector and Serializer】変数ごとのコンテキストメニューに項目を追加する「CustomContextMenu」属性

目次 「CustomContextMenu」属性 「CustomContextMenu」属性を使用すると 変数を右クリックした時に表示されるコンテキストメニューに 項目を追加することができます using Sirenix.OdinInspector; using UnityEngine; public class Example : MonoBehaviour…

【Unity】【Odin - Inspector and Serializer】変数のコピー・ペースト、配列やリストの削除が可能

目次 変数のコピー・ペーストが可能 変数を右クリックすることで 値のコピーやペーストが可能です 配列やリストの削除 配列やリストの場合は すべての要素を削除することも可能です

【Unity】【Odin - Inspector and Serializer】値が変更された時に呼び出されるコールバック関数を設定できる「OnValueChanged」属性

目次 「OnValueChanged」属性 「OnValueChanged」属性を使用すると 変数やプロパティの値が変更された時に呼び出される コールバック関数を指定することができます using Sirenix.OdinInspector; using UnityEngine; public class Example : MonoBehaviour {…

【Unity】【Odin - Inspector and Serializer】パラメータを編集不可能にする「ReadOnly」属性

目次 「ReadOnly」属性 「ReadOnly」属性を使用すると 指定した変数やプロパティの編集が不可能になります using Sirenix.OdinInspector; using System.Collections.Generic; using UnityEngine; public class Example : MonoBehaviour { [ReadOnly] public …

【Unity】【Odin - Inspector and Serializer】カラーパレットから色を指定できるようになる「ColorPalette」属性

目次 「ColorPalette」属性 「ColorPalette」属性を使用すると カラーパレットから色を設定できるようになります using Sirenix.OdinInspector; using UnityEngine; public class Example : MonoBehaviour { [ColorPalette] public Color color1; [ColorPale…

【Unity】【Odin - Inspector and Serializer】シリアライズする(翻訳)

目次 メモ この記事は下記のページの一部翻訳となります http://sirenix.net/odininspector/manual/introduction/serialize-anything 翻訳には間違いがあるかもしれないのでご了承ください はじめに Odin のシリアライズシステムは、 通常ではシリアライズさ…

【Unity】【Odin - Inspector and Serializer】Attribute を使用したデザイン(翻訳)

目次 メモ この記事は下記のページの一部翻訳となります http://sirenix.net/odininspector/manual/introduction/design-with-attributes 翻訳には間違いがあるかもしれないのでご了承ください はじめに Odin ではクラスのメンバにいくつかの属性を適用する…

【Unity】【Odin - Inspector and Serializer】入門(翻訳)

目次 メモ この記事は下記のページの一部翻訳となります http://sirenix.net/odininspector/manual/introduction/getting-started 翻訳には間違いがあるかもしれないのでご了承ください はじめに Odin の具体的なクラスやメソッドについて知りたい場合は 下…