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);
            }
        }
示例#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);
     }
 }
示例#4
0
        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);
        }
示例#5
0
 public static bool IsKeyPressed(Keyboard.Code c)
 {
     return(s_Instance.IsKeyPressedImpl(c));
 }
示例#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]);
 }
示例#8
0
 private bool IsKeyPressedImpl(Keyboard.Code c)
 {
     return(m_KeyPressed[(int)c]);
 }