DoubleConstrainedValue

顯示已棄用項目

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡

已棄用

一個使用數值創建器,數值永遠不能少於最小值或最大值。

概要

屬性

屬性

ConstrainedValue

隱藏
未複製
平行讀取

MaxValue

平行讀取

Class.DoubleConstrainedValue.Value 屬性可以包含的最高數值。

MinValue

平行讀取

Class.DoubleConstrainedValue.Value 屬性可以包含的最低數字。

Value

未複製
平行讀取

用於在 DoubleConstrainedValue.MinValueDoubleConstrainedValue.MaxValue 之間保持數值。

方法

活動

Changed

發射 當 DoubleConstrainedValue.ValueDoubleConstrainedValue 變更時發射。

參數

value: number

範例程式碼

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