public void ListenKeyboardEvent(Keyboard.Code c, MyAction <int, int> handler) { if (!m_KeysForListen.Contains((int)c)) { m_KeysForListen.Add((int)c); } m_KeyboardHandlers[(int)c] = handler; }
private void PlayUseSkill(Keyboard.Code keyCode) { var keybings = Contexts.sharedInstance.input.skillKeyBinding.Value; int skillIndex = 0; if (keybings.TryGetValue(keyCode, out skillIndex)) { StartSkillWithCategoryAndIndex(skillIndex, skillIndex); } }
private void ListenKeyboardEventImpl(Keyboard.Code c, MyAction <int, int> handler) { if (m_KeyboardHandlers.ContainsKey((int)c)) { m_KeyboardHandlers[(int)c] = handler; } else { m_KeyboardHandlers.Add((int)c, handler); } }
private Keyboard.Code GetKeyCode(KeyIndex index) { Keyboard.Code ret = Keyboard.Code.W; if (index >= KeyIndex.W && index <= KeyIndex.D) { Keyboard.Code[] list = s_Normal; /*if (WorldSystem.Instance.IsPvpScene()) { * int campId = WorldSystem.Instance.CampId; * if (campId == (int)CampIdEnum.Blue) * list = s_Blue; * else if (campId == (int)CampIdEnum.Red) * list = s_Red; * }*/ ret = list[(int)index]; } return(ret); }
public static bool IsKeyPressed(Keyboard.Code c) { return(s_Instance.IsKeyPressedImpl(c)); }
//事件注册,事件处理会通过IActionQueue在游戏逻辑线程处理(仅在初始化时调用【第一次tick前】) public static void ListenKeyboardEvent(Keyboard.Code c, MyAction <int, int> handler) { s_Instance.ListenKeyboardEventImpl(c, handler); }
public bool IsKeyPressed(Keyboard.Code c) { return(m_KeyPressed[(int)c]); }
private bool IsKeyPressedImpl(Keyboard.Code c) { return(m_KeyPressed[(int)c]); }