RangeAttribute
Last updated
Last updated
Specify a range of valid values for the field in script properties.
[System.AttributeUsage(System.AttributeTargets.Field)] public class RangeAttribute : Attribute
Specify the allowed range of values for a field using named arguments.
Syntaxpublic RangeAttribute ()
Remarks
Example
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Specify the allowed range of values for a float or double field.
SyntaxParameters
min
The lower bound on the range. Default: 0.0f
max
The upper bound on the range. Default: 0.0f
Remarks
Example
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Specify the allowed range of values for an int field.
Syntaxpublic RangeAttribute (int min, int max)
Parameters
min
The lower bound on the range. Default: 0
max
The upper bound on the range. Default: 0
Remarks
Example
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Used with default constructor to specify the upper bound on the range.
Syntaxpublic object Max { get; set; }
Value
The maximum allowed value for the parameter.
Remarks
Example
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
Used with default constructor to specify the lower bound on the range.
Syntaxpublic object Min { get; set; }
Value
The minimum allowed value for the parameter.
Remarks
Example
RequirementsNamespace: Sansar.Script Assembly: Sansar.Script (in Sansar.Script.dll) Assembly Versions: 1.0.0.0
C# Example
C# Example
C# Example
C# Example
C# Example