Exemplo n.º 1
0
        static public bool GetKeybindKeysArePressed(Keybind pKeybind)
        {
            bool yes        = false;
            bool allPressed = true;

            for (int i = 0; i < pKeybind.keycodes.Length; i++)
            {
                if (pKeybind.keysPressed[i])
                {
                    yes = true;
                }
                else
                {
                    allPressed = false;
                }
            }
            return(yes && ((pKeybind.allKeysAtOnce) ? allPressed : true));
        }
Exemplo n.º 2
0
        static public void UnsubscribeFromKeyup(string keybindName, UnityAction callback)
        {
            Keybind keybind = GetKeybindByName(keybindName);

            keybind.OnKeyUp.RemoveListener(callback);
        }
Exemplo n.º 3
0
        static public void SubscribeToKeyup(string keybindName, UnityAction callback)
        {
            Keybind keybind = GetKeybindByName(keybindName);

            keybind.OnKeyUp.AddListener(callback);
        }