// Copyright (c) 2012-2023 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.
///
///
[Serializable]
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
public sealed class LimitAttribute : Attribute
{
///
/// The minimum range value.
///
public float Min;
///
/// The maximum range value.
///
public float Max;
///
/// The slider speed used to edit value.
///
public float SliderSpeed;
private LimitAttribute()
{
Min = 0.0f;
Max = 100.0f;
SliderSpeed = 1.0f;
}
///
/// Initializes a new instance of the class.
///
/// The minimum limit value.
/// The maximum limit value.
/// The slider speed.
public LimitAttribute(float min, float max = float.MaxValue, float sliderSpeed = 1.0f)
{
Min = min;
Max = max;
SliderSpeed = sliderSpeed;
}
}
}