Controller

显示已弃用

*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

无法创建

控制器对象的基础类,例如 HumanoidController 对象。

概要

方法

活动

属性

方法

BindButton

()

激活指定按钮上的覆盖绑定。

参数

button: Enum.Button
默认值:""
caption: string
默认值:""

返回

()

代码示例

The example below when placed inside a LocalScript, would result in a GUI saying "Press Backspace to win!".

Controller:BindButton1

local ControllerService = game:GetService("ControllerService")
local humanoidController = ControllerService:FindFirstChildOfClass("HumanoidController")
humanoidController:BindButton(Enum.Button.Dismount, "win!")

GetButton

返回按钮是否被按下。

参数

button: Enum.Button
默认值:""

返回

UnbindButton

()

移除按钮上的绑定。

参数

button: Enum.Button
默认值:""

返回

()

活动

ButtonChanged

在按钮紧密状态发生变化时发射。这个事件可以与 Controller:GetButton() 结合使用,以确定是否按下了绑定按钮或没有。

参数

button: Enum.Button