// Copyright (c) Wojciech Figat. All rights reserved. using System; namespace FlaxEngine { /// /// Used to make a float or int variable in a script be restricted to a specific range. /// When used, the float or int will be shown as a slider in the editor instead of default number field. /// /// [Serializable] [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public sealed class RangeAttribute : Attribute { /// /// The minimum range value. /// public float Min; /// /// The maximum range value. /// public float Max; private RangeAttribute() { Min = 0.0f; Max = 1.0f; } /// /// Initializes a new instance of the class. /// /// The minimum range value. /// The maximum range value. public RangeAttribute(float min, float max) { Min = min; Max = max; } } }