用于创建一个数值,其永远不能小于 MinValue 或大于 MaxValue 的实例。
概要
属性
DoubleConstrainedValue.Value 属性最高可以达到的数字。
DoubleConstrainedValue.Value 属性最低可以达到的数字。
用于在 DoubleConstrainedValue.MinValue 和 DoubleConstrainedValue.MaxValue 之间保持一个数值。
活动
每当 DoubleConstrainedValue.Value 的 DoubleConstrainedValue 被更改时,都会发射。
属性
方法
活动
Changed
每当 DoubleConstrainedValue.Value 的 DoubleConstrainedValue 被更改时,都会发射。
参数
代码示例
The below example, assuming all referenced objects existed, would print the DoubleConstrainedValue's new value each time it's changed. In the example below it would print 2, assuming it's within DoubleConstrainedValue's MinValue and MaxValue range. Otherwise there will be no change.
DoubleConstrainedValue.Changed
workspace.DoubleConstrainedValue.Changed:Connect(function(newValue)
print(newValue)
end)
workspace.DoubleConstrainedValue.Value = 2