コード例 #1
0
    public bool ApplyChanges()
    {
        InputAction inputAction = inputManager.getInputActions().Get(actionInputIndex);

        Debug.Log("UIKeyBind: Checking for changes " + actionInputCopy + " from " + inputAction);
        if (actionInputCopy != null && !actionInputCopy.DoKeysMatch(inputAction))
        {
            Debug.Log("UIKeyBind: Has changed");
            actionInputCopy.CopyKeysInto(inputAction);
            return(true);
        }
        return(false);
    }
コード例 #2
0
    public void CopyKeysInto(InputActionHolder holder)
    {
        up.CopyKeysInto(holder.up);
        down.CopyKeysInto(holder.down);
        left.CopyKeysInto(holder.left);
        right.CopyKeysInto(holder.right);

        slow.CopyKeysInto(holder.slow);

        rotateLeft.CopyKeysInto(holder.rotateLeft);
        rotateRight.CopyKeysInto(holder.rotateRight);

        release.CopyKeysInto(holder.release);
        hook.CopyKeysInto(holder.hook);

        shoot.CopyKeysInto(holder.shoot);

        zoomIn.CopyKeysInto(holder.zoomIn);
        zoomOut.CopyKeysInto(holder.zoomOut);
    }
コード例 #3
0
    InputAction CheckForIssues(InputAction currentInput, InputAction defaultInput)
    {
        Debug.Log("InputActionHolder: Checking " + currentInput + " against default " + defaultInput);

        //Check for null
        if (currentInput == null)
        {
            hadIssues = true;
            Debug.Log("InputActionHolder: missing action input for " + defaultInput.displayName);
            return(defaultInput.Copy());
        }

        //Force name
        currentInput.displayName = defaultInput.displayName;

        if (currentInput.primary == null && currentInput.secondary == null)
        {
            Debug.Log("InputActionHolder: missing keybinds for " + defaultInput.displayName);
            defaultInput.CopyKeysInto(currentInput);
            hadIssues = true;
        }

        return(currentInput);
    }