エンジンクラス
DragDetector
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
概要
プロパティ
ActivatedCursorIcon:ContentId |
方法
AddConstraintFunction(priority: number,function: function):RBXScriptConnection |
RestartDrag():() |
SetDragStyleFunction(function: function):() |
SetPermissionPolicyFunction(function: function):() |
イベント
DragContinue(playerWhoDragged: Player,cursorRay: Ray,viewFrame: CFrame,vrInputFrame: OptionalCoordinateFrame,isModeSwitchKeyDown: boolean):RBXScriptSignal |
DragEnd(playerWhoDragged: Player):RBXScriptSignal |
APIリファレンス
プロパティ
ActivatedCursorIcon
DragDetector.ActivatedCursorIcon:ContentId
方法
AddConstraintFunction
RestartDrag
DragDetector:RestartDrag():()
戻り値
()
SetDragStyleFunction
SetPermissionPolicyFunction
パラメータ
戻り値
()
コードサンプル
権限ポリシー関数の設定
local part = Instance.new("Part")
part.Parent = workspace
local dragDetector = Instance.new("DragDetector")
dragDetector.Parent = part
dragDetector.PermissionPolicy = Enum.DragDetectorPermissionPolicy.Scriptable
dragDetector:SetPermissionPolicyFunction(function(player, part)
if player and player:GetAttribute("IsInTurn") then
return true
elseif part and not part:GetAttribute("IsDraggable") then
return false
else
return true
end
end)イベント
DragContinue
DragStart