OdinInspectorシリーズチュートリアル---範囲属性



Odin Inspector Series Tutorial Range Attribute



範囲属性:Unityには、値のスライディングコントロールを作成するために使用される属性が付属しています

7643202-4ad4452163327960.gifusing Sirenix.OdinInspector using UnityEngine public class RangeAttributeExample : MonoBehaviour { [Range(0, 10)] public int Field = 2 [InfoBox('Odin's PropertyRange property is similar to Unity's Range property, but also applies to properties.')] [ShowInInspector, PropertyRange(0, 10)] public int Property { get set } [InfoBox('You can also reference members for one or both of the minimum and maximum values.')] [PropertyRange(0, 'Max'), PropertyOrder(3)] public int Dynamic = 6 [PropertyOrder(4)] public int Max = 100 }