Class MinValueAttribute
Sets a minimum value for the target field. Automatically prevents assigning a value less than the specified value when editing the field in the inspector window
Inheritance
System.Object
System.Attribute
UnityEngine.PropertyAttribute
MinValueAttribute
Implements
System.Runtime.InteropServices._Attribute
Inherited Members
UnityEngine.PropertyAttribute.order
Namespace: Atlas
Assembly: Atlas.Runtime.dll
Syntax
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
public sealed class MinValueAttribute : PropertyAttribute, _Attribute
Examples
using UnityEngine;
namespace Atlas.Examples
{
public sealed class Example_MinValueAttribute : MonoBehaviour
{
// prevents assigning values < 0 in the inspector
[SerializeField, MinValue( 0.0f )] private float m_value;
}
}
Constructors
| Improve this Doc View SourceMinValueAttribute(Single)
Constructor
Declaration
public MinValueAttribute(float minValue)
Parameters
Type | Name | Description |
---|---|---|
System.Single | minValue | The minimum allowable value the field can have |
Properties
| Improve this Doc View SourceMinValue
The minimum allowable value the field can have
Declaration
public float MinValue { get; }
Property Value
Type | Description |
---|---|
System.Single |
Implements
System.Runtime.InteropServices._Attribute