#nullable enable
namespace UVC.UIToolkit
{
///
/// 실수 속성 데이터 클래스입니다.
/// UI는 UTKFloatPropertyItemView에서 담당합니다.
///
public class UTKFloatPropertyItem : UTKPropertyItemBase
{
#region Fields
private bool _useSlider;
private float _minValue;
private float _maxValue = 1f;
#endregion
#region Properties
/// 속성 타입
public override UTKPropertyType PropertyType => UTKPropertyType.Float;
/// 슬라이더 사용 여부
public bool UseSlider
{
get => _useSlider;
set => _useSlider = value;
}
/// 최소값 (슬라이더 모드)
public float MinValue
{
get => _minValue;
set => _minValue = value;
}
/// 최대값 (슬라이더 모드)
public float MaxValue
{
get => _maxValue;
set => _maxValue = value;
}
#endregion
#region Constructor
///
/// 실수 속성을 생성합니다 (필드 모드).
///
/// 고유 ID
/// 표시 이름
/// 초기 값
/// 읽기 전용 여부
public UTKFloatPropertyItem(string id, string name, float initialValue = 0f, bool isReadOnly = false)
: base(id, name, initialValue)
{
IsReadOnly = isReadOnly;
}
///
/// 실수 속성을 생성합니다 (슬라이더 모드).
///
/// 고유 ID
/// 표시 이름
/// 초기 값
/// 최소값
/// 최대값
/// 슬라이더 사용 여부
/// 읽기 전용 여부
public UTKFloatPropertyItem(string id, string name, float initialValue, float minValue = float.MinValue, float maxValue = float.MaxValue, bool useSlider = true, bool isReadOnly = false)
: base(id, name, initialValue)
{
_minValue = minValue;
_maxValue = maxValue;
_useSlider = useSlider;
IsReadOnly = isReadOnly;
}
#endregion
}
}