Ravenfield

Ravenfield

Custom Keybinds for Mutator Mods
 此主题已被置顶,因此可能具有重要性
Gaheris96  [开发者] 2020 年 7 月 9 日 下午 3:00
IF YOU ARE A MODDER
This mod allows you to easily use custom keybinds by converting keys and keycodes as string to KeyCode

How to use it :
function YourScript:Start() self.script.StartCoroutine("initCoroutine"); end function YourScript:initCoroutine() coroutine.yield(WaitForSeconds(1)) local go = GameObject.Find("Custom Keybinds"); if(go != nil) then local customKB = ScriptedBehaviour.GetScript(go); local key = self.script.mutator.GetConfigurationString("customKey"); if(key != nil or key != "") then local kcode = customKB:getKeyCodeFromCustomKey(key); if(kcode ~= nil and kcode ~= KeyCode.None) then self.customKey = kcode; end end end end

and then you can use that KeyCode as any other KeyCode :

if(self.customKey ~= nil and Input.GetKeyDown(self.customKey)) then print("Hello World !") end
< >
正在显示第 1 - 1 条,共 1 条留言
Chai 2020 年 7 月 14 日 上午 3:51 
Cool
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50