Skip to content

Game_Switches

Kind: global class

  • Game_Switches
    • new Game_Switches()
    • .initialize()
    • .clear()
    • .value(switchId) ⇒ boolean
    • .setValue(switchId, value)
    • .onChange()

new Game_Switches()

管理游戏中所有开关的状态,开关用于控制游戏流程和事件触发


game_Switches.initialize()

初始化开关对象并清空所有数据

Kind: instance method of Game_Switches


game_Switches.clear()

清空所有开关数据,重置为初始状态

Kind: instance method of Game_Switches


game_Switches.value(switchId) ⇒ boolean

获取指定开关的状态值

Kind: instance method of Game_Switches
Returns: boolean - 开关的状态值(true 或 false)

ParamTypeDescription
switchIdnumber开关 ID

game_Switches.setValue(switchId, value)

设置指定开关的状态值,并触发变化事件

Kind: instance method of Game_Switches

ParamTypeDescription
switchIdnumber开关 ID
valueboolean要设置的值

game_Switches.onChange()

当开关状态发生变化时调用,请求地图刷新以更新相关事件

Kind: instance method of Game_Switches


贡献者

暂无相关贡献者

页面历史

暂无最近变更历史
最近更新