示例#1
0
 public InputActionHolder getInputActions()
 {
     if (currentInputActions == null)
     {
         currentInputActions = new InputActionHolder();
     }
     return(currentInputActions);
 }
示例#2
0
    //Make sure to add new actions to CollectActionInputs(List) method

    //Copies keybinds into other holder
    public void CopyInto(InputActionHolder holder)
    {
        holder.up    = up.Copy();
        holder.down  = down.Copy();
        holder.left  = left.Copy();
        holder.right = right.Copy();

        holder.slow = slow.Copy();

        holder.rotateLeft  = rotateLeft.Copy();
        holder.rotateRight = rotateRight.Copy();

        holder.release = release.Copy();
        holder.hook    = hook.Copy();

        holder.shoot = shoot.Copy();

        holder.zoomIn  = zoomIn.Copy();
        holder.zoomOut = zoomOut.Copy();
    }
示例#3
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);
    }
示例#4
0
    public void SetCurrentKeybindHolder(InputActionHolder inputActions)
    {
        Debug.Log("PlayerInputManager: Setting current input action holder '" + inputActions + "'");
        currentInputActions = inputActions;

        if (currentInputActions != null)
        {
            //Fix any issues
            Debug.Log("PlayerInputManager: Checking for issues");
            bool hadIssues = currentInputActions.CheckForIssues(defaultInputActions);
            if (!hadIssues)
            {
                Debug.Log("PlayerInputManager: No issues found with input action holder");
            }

            //Save a new copy to disk if we had issues that were fixed
            if (hadIssues)
            {
                Debug.Log("PlayerInputManager: Due to issues found saving new player_controls copy to disk");
                SaveToDisc();
            }
        }
    }
示例#5
0
    public bool CheckForIssues(InputActionHolder defaultSettings)
    {
        hadIssues = false;

        up    = CheckForIssues(up, defaultSettings.up);
        down  = CheckForIssues(down, defaultSettings.down);
        left  = CheckForIssues(left, defaultSettings.left);
        right = CheckForIssues(right, defaultSettings.right);

        slow = CheckForIssues(slow, defaultSettings.slow);

        rotateLeft  = CheckForIssues(rotateLeft, defaultSettings.rotateLeft);
        rotateRight = CheckForIssues(rotateRight, defaultSettings.rotateRight);

        release = CheckForIssues(release, defaultSettings.release);
        hook    = CheckForIssues(hook, defaultSettings.hook);

        shoot = CheckForIssues(shoot, defaultSettings.shoot);

        zoomIn  = CheckForIssues(zoomIn, defaultSettings.zoomIn);
        zoomOut = CheckForIssues(zoomOut, defaultSettings.zoomOut);

        return(hadIssues);
    }