一个 IntConstrainedValue 用于存储一个值,它的值永远不能少于 MinValue ,也不能超过 MaxValue。
概要
属性
在 Integer 和 IntConstrainedValue.MinValue 之间保持一个 IntConstrainedValue.MaxValue 值。 替换为 2>Class.IntConstrainedValue.Value2> ,但仍然功能性。
Class.IntConstrainedValue.Value 属性可以包含的最高数值。
Class.IntConstrainedValue.Value 属性可以设置的最低数值。
用于将整数值 IntConstrainedValue.MinValue 和 IntConstrainedValue.MaxValue 之间的值。
活动
当 IntConstrainedValue 的值发生时。
属性
ConstrainedValue
在 Integer 和 IntConstrainedValue.MinValue 之间保持一个 IntConstrainedValue.MaxValue 值。 替换为 2>Class.IntConstrainedValue.Value2> ,但仍然功能性。
方法
活动
Changed
当 IntConstrainedValue 的值发生时。
参数
代码示例
The below example, assuming all referenced objects existed, would print the IntConstrainedValue's new value each time it's changed. In the example below it would print 2, assuming it's within IntConstrainedValue's MinValue and MaxValue range. Otherwise there will be no change.
local function valueChanged(newValue)
print(newValue)
end
workspace.IntConstrainedValue.Changed:Connect(valueChanged)
workspace.IntConstrainedValue.Value = 2