ContextActionService
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
ユーザーの入力をコンテキストアクション、または期間限定のアクショ
コンテキストとアクション
コンテキスト は、Class.Tool を持っているプレイヤーがいくつかのアクションを実行する条件です。一部の例は、 Class.Seat|
アクションは、プレイヤーがそのコ
アクションコンテキストでバインディング
コンテキストアクショ
バウンドアクションをインスペクト中
アクションとそのバインド入力のリストを見るには、「アクションバインディング」タブを開発者コンソール (F9 を含む) の [アク
キーボードなしの入力
このサービスは、ゲームパッドとタッチ入力をサポートするために特に役立ちます。ゲームパッドの入力の場合、ユーザーが別のメニューに入るときに戻るメニューに
コードサンプル
This example properly shows how to use ContextActionService in binding user input to a contextual action. The context is the tool being equipped; the action is reloading some weapon. Test this code sample by placing it in a LocalScript parented to a Tool. When the Tool is equipped, a "Reload" action is bound, and when the Tool is unequipped the "Reload" action is unbound. When the player presses R with the Tool equipped, the message "Reloading!" will appear.
local ContextActionService = game:GetService("ContextActionService")
local ACTION_RELOAD = "Reload"
local tool = script.Parent
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_RELOAD and inputState == Enum.UserInputState.Begin then
print("Reloading!")
end
end
tool.Equipped:Connect(function()
ContextActionService:BindAction(ACTION_RELOAD, handleAction, true, Enum.KeyCode.R)
end)
tool.Unequipped:Connect(function()
ContextActionService:UnbindAction(ACTION_RELOAD)
end)
概要
方法
- BindAction(actionName : string,functionToBind : function,createTouchButton : bool,inputTypes : Tuple):void
アクション処理機能を持つユーザーの入力をアクションにバインドします。
Class.ContextActionService:BindAction()|BindAction のように動作するが、優先度を上位のバインドアクションに割り当てることもできる (higher before lower)。
Class.Tool.Activation1> と Class.ClickDetector1> イベントをトリガーするために、特定の Enum.UserInputType に Tool.Activation をバインドします。
すべてのバインドアクションに関する情報のテーブルを取得する (キーは BindAction 、値は GetBoundActionInfo を呼び出したときのテーブルです)。
バインドアクションの名前が元々 BindAction に渡されたテーブルを取得します。
Class.Player が現在 Class.Tool.Equipped|equipped を持っている Class.Tool の1> Class.BackpackItem.TextureId1> を返します。
ボタンでバインドされたアクションの名前を与え、アクショ操作の説明を設定します。
actionName キーにバインドされたアクションが含まれている場合、image はタッチボタンの操作像として設定されます。
ボタンでバインドされたアクションの名前を与えると、ボタンの位置をコンテキストボタンフレーム内に設定します。
ボタンでバインドされたアクションの名前を与え、ボタンに表示されるテキストを設定します。
入力の名前からアクションをバインド解除します。
- UnbindActivate(userInputTypeForActivation : Enum.UserInputType,keyCodeForActivation : Enum.KeyCode):void
Class.Tool.Activation1> をトリガーすると、Enum.UserInputType を指定の Tool.Activation でバインドします。
すべてのバインドされた関数を削除します。名前アクションは残りません。すべてのタッチボタンが削除されます。
Class.ImageButton を取得するbound アクションのタッチ入力ボタンが作成されたアクション。
イベント
プロパティ
方法
BindAction
アクションをユーザーの入力にバインドするアクション処理
コードサンプルは、Sound がキー ( played )、ゲームパッドボタン、またはタッチスクリーンボタンを押しながら Class.Sound:Play()|played できることを示しています。
local ContextActionService = game:GetService("ContextActionService")
-- 車のホーンの音
local honkSound = Instance.new("Sound", workspace)
honkSound.Looped = true
honkSound.SoundId = "rbxassetid://9120386436"
local function handleAction(actionName, inputState, inputObject)
if actionName == "HonkHorn" then
if inputState == Enum.UserInputState.Begin then
honkSound:Play()
else
honkSound:Pause()
end
end
end
-- プレイヤーが車両に座るとき:
ContextActionService:BindAction("HonkHorn", handleAction, true, Enum.KeyCode.H, Enum.KeyCode.ButtonY)
-- プレイヤーが出るとき:
ContextActionService:UnbindAction("HonkHorn")
アクションハンドラーパラメータ
アクションハンドラーは次のパラメーターで呼び出されます:
<tr><td>1</td><td><code>文字列</code></td><td>元々 BindAction に渡された同じストリング</td></tr><tr><td>2</td><td><code>enum.UserInputState</code></td><td>入力の状態 (開始、変更、終了またはキャンセル)\*</td></tr><tr><td>3</td><td><code>InputObject</code></td><td>入力に関する情報を含むオブジェクト (ユーザー入力タイプによって変更)</td></tr>
# | タイプ | 説明 |
※これにより、1つの関数で複数のアクションを一度に処理できます。※必要に応じて、Cancel は、進行中の入力があり、別のアクションがインプログレス中の入力にバインドされている場合、またはインプログレスバインドされたアクションが unbound である場合に送信されます。
アクションバインディングスタック
アクシ
ボタンにタッチする
入力タイプに加えて、この関数の 3 番目のパラメータは、ボタンが Class.UserInputService.
パラメータ
実行されるアクションを表示するストリング (例: "HonkHorn" または "OpenDoor")。
バインド入力がトリガーされたときに次のパラメータで呼び出されるアクション処理関数: string (actionName)、Enum.UserInputState およびインプットオブジェクト。
タッチ入力デバイスのアクションに対する GUI ボタンを作成するかどうか。
枚数 KeyCode または Enum.UserInputType がアクションにバインドされる入力を表示します。
戻り値
コードサンプル
This example properly shows how to use ContextActionService in binding user input to a contextual action. The context is the tool being equipped; the action is reloading some weapon. Test this code sample by placing it in a LocalScript parented to a Tool. When the Tool is equipped, a "Reload" action is bound, and when the Tool is unequipped the "Reload" action is unbound. When the player presses R with the Tool equipped, the message "Reloading!" will appear.
local ContextActionService = game:GetService("ContextActionService")
local ACTION_RELOAD = "Reload"
local tool = script.Parent
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_RELOAD and inputState == Enum.UserInputState.Begin then
print("Reloading!")
end
end
tool.Equipped:Connect(function()
ContextActionService:BindAction(ACTION_RELOAD, handleAction, true, Enum.KeyCode.R)
end)
tool.Unequipped:Connect(function()
ContextActionService:UnbindAction(ACTION_RELOAD)
end)
This code sample uses ContextActionService to bind an action named "BoundAction" to a general action handler function on the F key. Place this in a LocalScript inside StarterPlayerScripts and press F to see the message "Handling action: BoundAction".
local ContextActionService = game:GetService("ContextActionService")
local function handleAction(actionName, inputState, inputObj)
if inputState == Enum.UserInputState.Begin then
print("Handling action: " .. actionName)
print(inputObj.UserInputType)
end
-- Since this function does not return anything, this handler will
-- "sink" the input and no other action handlers will be called after
-- this one.
end
ContextActionService:BindAction("BoundAction", handleAction, false, Enum.KeyCode.F)
This code sample demonstrates how BindAction acts like a stack. It binds two actions, FirstAction (Z, X, and C keys) and SecondAction (Z and X keys) to two action handling functions. The second one will pass on a certain input (the X key).
Both actions use the Z and X keys, however the second handler will pass input only if X is pressed. So, when X is pressed, the second handler is called and then the first. The first action is also bound to the C key, and can be triggered even though the other two inputs are "covered" by the second action.
Test this code out by pasting it into a LocalScript within StarterPlayerScripts, then pressing Z, X and C. Observe which action handlers are called with what actions.
local ContextActionService = game:GetService("ContextActionService")
-- Define an action handler for FirstAction
local function actionHandlerOne(actionName, inputState, _inputObj)
if inputState == Enum.UserInputState.Begin then
print("Action Handler One: " .. actionName)
end
-- This action handler returns nil, so it is assumed that
-- it properly handles the action.
end
-- Binding the action FirstAction (it's on the bottom of the stack)
ContextActionService:BindAction("FirstAction", actionHandlerOne, false, Enum.KeyCode.Z, Enum.KeyCode.X, Enum.KeyCode.C)
-- Define an action handler for SecondAction
local function actionHandlerTwo(actionName, inputState, inputObj)
if inputState == Enum.UserInputState.Begin then
print("Action Handler Two: " .. actionName)
end
if inputObj.KeyCode == Enum.KeyCode.X then
return Enum.ContextActionResult.Pass
else
-- Returning nil implicitly Sinks inputs
return Enum.ContextActionResult.Sink
end
end
-- Binding SecondAction over the first action (since it bound more recently, it is on the top of the stack)
-- Note that SecondAction uses the same keys as
ContextActionService:BindAction("SecondAction", actionHandlerTwo, false, Enum.KeyCode.Z, Enum.KeyCode.X)
BindActionAtPriority
BindActionAtPriority は BindAction のように動作するが、優先度をバインドアクションに割り当てることもできる。複数のアクションが同じ入力にバインドされている場合、優先度の高い関数はアクション操作バインド順序を問わず呼び出される。つまり、この関数は BindAction のデフォルトの
パラメータ
実行されるアクションを表示するストリング (例: "HonkHorn" または "OpenDoor")。
バインド入力がトリガーされたときに次のパラメータで呼び出されるアクション処理関数: string (actionName)、Enum.UserInputState およびインプットオブジェクト。
タッチ入力デバイスのアクションに対する GUI ボタンを作成するかどうか。
アクションにバインドする優先レベル (下位のものを優先します)。
任意の枚数の Enum.KeyCode または Enum.UserInputType 、アクションにバインドする入操作を表示します。
戻り値
コードサンプル
This code sample demonstrates how ContextActionService:BindActionAtPriority() can be used to bind actions out of order yet still have the same priority levels. Normally, BindAction() would operate on order (last bound action has highest priority), but priority levels override this. You can test this code by pasting it into a Script with RunContext = Client in ReplicatedStorage.
local ContextActionService = game:GetService("ContextActionService")
local INPUT_KEY1 = Enum.KeyCode.Q
local INPUT_KEY2 = Enum.KeyCode.E
local function handleThrow(actionName: string, inputState: Enum.UserInputState, inputObject: InputObject)
if inputState ~= Enum.UserInputState.Begin then
return Enum.ContextActionResult.Pass
end
print(`Action [{actionName}] occurred. KeyCode [{inputObject.KeyCode}] pressed.`)
return Enum.ContextActionResult.Sink
end
local function handlePunch(actionName: string, inputState: Enum.UserInputState, inputObject: InputObject)
if inputState ~= Enum.UserInputState.Begin then
return Enum.ContextActionResult.Pass
end
print(`Action [{actionName}] occurred. KeyCode [{inputObject.KeyCode}] pressed.`)
return Enum.ContextActionResult.Sink
end
-- Without specifying priority, the most recently bound action is called first,
-- so pressing INPUT_KEY1 prints "Punch" and then sinks the input.
ContextActionService:BindAction("DefaultThrow", handleThrow, false, INPUT_KEY1)
ContextActionService:BindAction("DefaultPunch", handlePunch, false, INPUT_KEY1)
-- Here we bind both functions in the same order as above, but with explicitly swapped priorities.
-- That is, we give "Throw" a higher priority of 2 so it will be called first,
-- despite "Punch" still being bound more recently.
-- Pressing INPUT_KEY2 prints "Throw" and then sinks the input.
ContextActionService:BindActionAtPriority("PriorityThrow", handleThrow, false, 2, INPUT_KEY2)
ContextActionService:BindActionAtPriority("PriorityPunch", handlePunch, false, 1, INPUT_KEY2)
BindActivate
バインド Enum.KeyCode 、および Enum.UserInputType で使用できる ClickDetector イベントをマウスの 2>Class
注意: 指定された Enum.UserInputType は、Keyboard または Gamepad1 を通じて 2>Gamepad82> で有効になる必要があります。
パラメータ
Gamepad8 を通じて Keyboard または Gamepad1 でなければなりません。
戻り値
GetAllBoundActionInfo
GetAllBindActioninfo は、オリジナルに BindAction にマップされたすべてのアクションの名前をテーブルに返します。この関数を使用すると、アクション名自体をデバッグすることができます。これは、優先レベルやスタックオーダーをデバッグするた
戻り値
GetBoundActionInfo
GetBoundActionInfo は、名前を与えたバインドアクションの説明を含むテーブルを返します。同じ情報をすべてのアクションに一度に取得するには、GetAllBoundActionInfo を使用します。
<tr><td><code>スタックオーダー</code></td><td>番号</td><td>スタックのアクションのインデックス (増加) を説明します</td></tr><tr><td><code>優先レベル</code> \*</td><td>番号</td><td>アクションの <code>Class.ContextActionService:BindActionAtPriority()|優先度</code> レベルを説明します</td></tr><tr><td><code>ボタンを作成する</code></td><td>ブール</td><td>Class.UserInputService.TouchEnabled|TouchEnabled デバイスにボタンを作成するかどうかを記述します</td></tr><tr><td><code>入力タイプ</code></td><td>テーブル</td><td>このアクションがトリガーする <code>Class.ContextActionService:BindAction()|BindAction</code> の入力タイプには、バインドアクション があります</td></tr><tr><td><code>説明</code> ※</td><td>文字列</td><td>Class.ContextActionService:SetDescription()|SetDescription によって設定されたアクションの説明</td></tr><tr><td><code>タイトル</code> ※</td><td>文字列</td><td>Class.ContextActionService:SetTitle()|SetTitle によって設定されたアクションのタイトル</td></tr><tr><td><code>画像</code> †</td><td>文字列</td><td>Class.ContextActionService:SetImage()|SetImage によって設定されたアクションのボターの画像</td></tr>
名前 | タイプ | 説明 |
優先レベルは、BindActionAtPriority が使用されていなくても含まれます - デフォルトでは 2000 です。
※このフィールドが関連するメソッドが呼び出されていない場合、このフィールドは nil になります。
パラメータ
戻り値
GetCurrentLocalToolIcon
GetCurrentLocalToolIcon は、BackpackItem.TextureId の Class.Tool の現在の Tool によって、equipped または 1> nil1> がツールを持っていない場合、または 4>
戻り値
ツールのテクスチャID か n が見つからなかった場合は、コンテンツストリング。
SetDescription
SetDescription は、BindAction によってバインドされたアクションの説明を設定します。リストにあるアクションの中で、これは、指定されたアクショ操作を説明するテキストです。
名前は、このメソッドがタッチボタンを作成する関数の家族に関連していると示唆するかもしれません (SetTitle、SetImage およびSetPosition
パラメータ
以前は BindAction にアクションの名前が渡されました。
オークションの説明テキスト、例えば「車のホーンを鳴らす」または「インベントリを開く」など。
戻り値
コードサンプル
This code sample demonstrates binding an "Inspect" action to a touch button created automatically by ContextActionService. The button is customized using SetImage(), SetTitle(), SetDescription() and SetPosition(). The button is further customized by using GetButton() to get a reference to the ImageButton itself and tinting it green by setting ImageButton.ImageColor3.
Paste this code into a LocalScript placed within StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.
local ContextActionService = game:GetService("ContextActionService")
local ACTION_INSPECT = "Inspect"
local INPUT_INSPECT = Enum.KeyCode.E
local IMAGE_INSPECT = "rbxassetid://1826746856" -- Image of a speech bubble with ? in it
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_INSPECT and inputState == Enum.UserInputState.End then
print("Inspecting")
end
end
-- For touch devices, a button is created on-screen automatically via the 3rd parameter
ContextActionService:BindAction(ACTION_INSPECT, handleAction, true, INPUT_INSPECT)
-- We can use these functions to customize the button:
ContextActionService:SetImage(ACTION_INSPECT, IMAGE_INSPECT)
ContextActionService:SetTitle(ACTION_INSPECT, "Look")
ContextActionService:SetDescription(ACTION_INSPECT, "Inspect something.")
ContextActionService:SetPosition(ACTION_INSPECT, UDim2.new(0, 0, 0, 0))
-- We can manipulate the button directly using ContextActionService:GetButton
local imgButton = ContextActionService:GetButton(ACTION_INSPECT)
if imgButton then -- Remember: non-touch devices won't return anything!
imgButton.ImageColor3 = Color3.new(0.5, 1, 0.5) -- Tint the ImageButton green
end
SetImage
このメソッドは、BindAction() によって作成されたタッチボタンの画像を設定します。具体的に、ImageLabel.Image プロパティのClass.Image
この関数は、アクションのタッチボタンをカスタマイズするメソッドの一族の一部です。他のメソッドの一族には SetPosition と SetTitle があります。
パラメータ
戻り値
コードサンプル
This code sample demonstrates binding an "Inspect" action to a touch button created automatically by ContextActionService. The button is customized using SetImage(), SetTitle(), SetDescription() and SetPosition(). The button is further customized by using GetButton() to get a reference to the ImageButton itself and tinting it green by setting ImageButton.ImageColor3.
Paste this code into a LocalScript placed within StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.
local ContextActionService = game:GetService("ContextActionService")
local ACTION_INSPECT = "Inspect"
local INPUT_INSPECT = Enum.KeyCode.E
local IMAGE_INSPECT = "rbxassetid://1826746856" -- Image of a speech bubble with ? in it
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_INSPECT and inputState == Enum.UserInputState.End then
print("Inspecting")
end
end
-- For touch devices, a button is created on-screen automatically via the 3rd parameter
ContextActionService:BindAction(ACTION_INSPECT, handleAction, true, INPUT_INSPECT)
-- We can use these functions to customize the button:
ContextActionService:SetImage(ACTION_INSPECT, IMAGE_INSPECT)
ContextActionService:SetTitle(ACTION_INSPECT, "Look")
ContextActionService:SetDescription(ACTION_INSPECT, "Inspect something.")
ContextActionService:SetPosition(ACTION_INSPECT, UDim2.new(0, 0, 0, 0))
-- We can manipulate the button directly using ContextActionService:GetButton
local imgButton = ContextActionService:GetButton(ACTION_INSPECT)
if imgButton then -- Remember: non-touch devices won't return anything!
imgButton.ImageColor3 = Color3.new(0.5, 1, 0.5) -- Tint the ImageButton green
end
SetPosition
このメソッドは、BindAction() によって作成されたタッチボタンの位置を設定します。具体的には、GuiObject.Position プロパティのImageButton が、2>Class.ContextActionService:Get
この関数は、アクションのタッチボタンをカスタマイズするメソッドの一族の一部です。他のメソッドの一族には SetImage と SetTitle があります。
パラメータ
戻り値
コードサンプル
This code sample demonstrates binding an "Inspect" action to a touch button created automatically by ContextActionService. The button is customized using SetImage(), SetTitle(), SetDescription() and SetPosition(). The button is further customized by using GetButton() to get a reference to the ImageButton itself and tinting it green by setting ImageButton.ImageColor3.
Paste this code into a LocalScript placed within StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.
local ContextActionService = game:GetService("ContextActionService")
local ACTION_INSPECT = "Inspect"
local INPUT_INSPECT = Enum.KeyCode.E
local IMAGE_INSPECT = "rbxassetid://1826746856" -- Image of a speech bubble with ? in it
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_INSPECT and inputState == Enum.UserInputState.End then
print("Inspecting")
end
end
-- For touch devices, a button is created on-screen automatically via the 3rd parameter
ContextActionService:BindAction(ACTION_INSPECT, handleAction, true, INPUT_INSPECT)
-- We can use these functions to customize the button:
ContextActionService:SetImage(ACTION_INSPECT, IMAGE_INSPECT)
ContextActionService:SetTitle(ACTION_INSPECT, "Look")
ContextActionService:SetDescription(ACTION_INSPECT, "Inspect something.")
ContextActionService:SetPosition(ACTION_INSPECT, UDim2.new(0, 0, 0, 0))
-- We can manipulate the button directly using ContextActionService:GetButton
local imgButton = ContextActionService:GetButton(ACTION_INSPECT)
if imgButton then -- Remember: non-touch devices won't return anything!
imgButton.ImageColor3 = Color3.new(0.5, 1, 0.5) -- Tint the ImageButton green
end
SetTitle
SetTitle は、BindAction によって作成されたタッチボタンの内容を設定します。特に、これは TextLabel.Text プロパティの
この関数は、アクションのタッチボタンをカスタマイズするメソッドの一族の一部です。他のメソッドの一族には SetImage と SetPosition があります。
パラメータ
戻り値
コードサンプル
This code sample demonstrates binding an "Inspect" action to a touch button created automatically by ContextActionService. The button is customized using SetImage(), SetTitle(), SetDescription() and SetPosition(). The button is further customized by using GetButton() to get a reference to the ImageButton itself and tinting it green by setting ImageButton.ImageColor3.
Paste this code into a LocalScript placed within StarterPlayerScripts to test it. In Studio, be sure to toggle the touch device emulator in order for the button to actually be created.
local ContextActionService = game:GetService("ContextActionService")
local ACTION_INSPECT = "Inspect"
local INPUT_INSPECT = Enum.KeyCode.E
local IMAGE_INSPECT = "rbxassetid://1826746856" -- Image of a speech bubble with ? in it
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_INSPECT and inputState == Enum.UserInputState.End then
print("Inspecting")
end
end
-- For touch devices, a button is created on-screen automatically via the 3rd parameter
ContextActionService:BindAction(ACTION_INSPECT, handleAction, true, INPUT_INSPECT)
-- We can use these functions to customize the button:
ContextActionService:SetImage(ACTION_INSPECT, IMAGE_INSPECT)
ContextActionService:SetTitle(ACTION_INSPECT, "Look")
ContextActionService:SetDescription(ACTION_INSPECT, "Inspect something.")
ContextActionService:SetPosition(ACTION_INSPECT, UDim2.new(0, 0, 0, 0))
-- We can manipulate the button directly using ContextActionService:GetButton
local imgButton = ContextActionService:GetButton(ACTION_INSPECT)
if imgButton then -- Remember: non-touch devices won't return anything!
imgButton.ImageColor3 = Color3.new(0.5, 1, 0.5) -- Tint the ImageButton green
end
UnbindAction
UnbindAction は、ユーザーの入力により名前のアクションをバインド解適用可能するため、アクションハンドラー機能はもう呼び出されません。コンテキストがユーザーインターフェイスを閉じるなど、アクションのバインドを無効にすると、 Class.Tool.
この文字列数 は、指定されたストリングにバインドされていないアクションがある場合でもエラーを投げることはありません。使用する Class.ContextActionService:GetAllBindActionInfo()|GetAllBindActionInfo または 「アクションバインディング」タブで、バインドされているアクションを見つけることができます。
パラメータ
戻り値
コードサンプル
This example properly shows how to use ContextActionService in binding user input to a contextual action. The context is the tool being equipped; the action is reloading some weapon. Test this code sample by placing it in a LocalScript parented to a Tool. When the Tool is equipped, a "Reload" action is bound, and when the Tool is unequipped the "Reload" action is unbound. When the player presses R with the Tool equipped, the message "Reloading!" will appear.
local ContextActionService = game:GetService("ContextActionService")
local ACTION_RELOAD = "Reload"
local tool = script.Parent
local function handleAction(actionName, inputState, _inputObject)
if actionName == ACTION_RELOAD and inputState == Enum.UserInputState.Begin then
print("Reloading!")
end
end
tool.Equipped:Connect(function()
ContextActionService:BindAction(ACTION_RELOAD, handleAction, true, Enum.KeyCode.R)
end)
tool.Unequipped:Connect(function()
ContextActionService:UnbindAction(ACTION_RELOAD)
end)
UnbindActivate
UnbindActivate は、 Enum.KeyCode を有効にするために使用される Enum.UserInputType をバインド解除します。この関数は、Tool を使用して、1> Class.HopperBin1> を有効にするために実行さ
パラメータ
元のユーザー入力タイプは BindActivate に送信されました。
元の KeyCode は BindActivate に送信されました。
戻り値
UnbindAllActions
すべてのバインドされた関数を削除します。ユーザー名は残りません。すべてのタッチボタンは削除されます。ボタンを手動で操作した場合は、清掃されることはありません。
戻り値
GetButton
GetButton は、 ImageButton を返します クラスコンテキストアクションサービス:バインドアクション が クラスユーザー入力サービス:タッチ有効化 が デバイスの場合、 if の第 3 引数が true であるとき、 BindAction の関数に一致する必要があります。
そのアクションがバインドされていないか、ボタンが作成されていない場合、この関数は nil を返します。
パラメータ
以前は BindAction にアクションの名前が渡されました。
戻り値
BindAction によって作成された画像ボタン。