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);
            }
        }
Beispiel #3
0
 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);
        }
Beispiel #5
0
 public static bool IsKeyPressed(Keyboard.Code c)
 {
     return(s_Instance.IsKeyPressedImpl(c));
 }
Beispiel #6
0
 //事件注册,事件处理会通过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]);
 }
Beispiel #8
0
 private bool IsKeyPressedImpl(Keyboard.Code c)
 {
     return(m_KeyPressed[(int)c]);
 }