用於創建數值,其永遠不能小於 MinValue 或超過 MaxValue 的實例。
概要
屬性
DoubleConstrainedValue.Value 屬性最高可以達到的數字。
DoubleConstrainedValue.Value 屬性可以達到的最低數值。
用於保持數值在 DoubleConstrainedValue.MinValue 和 DoubleConstrainedValue.MaxValue 之間。
活動
每當 DoubleConstrainedValue.Value 的 DoubleConstrainedValue 被更改時,都會發射。
屬性
方法
活動
Changed
每當 DoubleConstrainedValue.Value 的 DoubleConstrainedValue 被更改時,都會發射。
參數
範例程式碼
以下範例,假設所有參考對象存在,每次變更時都會列印 DoubleConstrainedValue 的新值。在下面的例子中,它將打印 2,假設它在 DoubleConstrainedValue 的 MinValue 和 MaxValue 範圍內。否則不會有任何變更。
雙重受限值。變更
workspace.DoubleConstrainedValue.Changed:Connect(function(newValue)
print(newValue)
end)
workspace.DoubleConstrainedValue.Value = 2