JU Input Manager

The JU Input Manager helps with input handling and cross-platform operation.

Simple Input Detection

This page will be useful when you want to expand the system, add actions or just detect inputs.

Using the JU Input Manager to detect inputs is simple, inspired by the old input system:

using UnityEngine;

// 1 Step -> Import JUInputSystem
using JUTPS.JUInputSystem;

public class JUInputHandlingTest : MonoBehaviour
{
    void Update()
    {
        // 2 Step -> Check if Jump Button(Space Default) was pressed
        if (JUInput.GetButtonDown(JUInput.Buttons.JumpButton))
        {
            Debug.Log("Pressed Jump");
        }
    }
}

In line 4 the JUInputSystem is imported, in line 11 the check is made if the jump button was pressed, and in line 13 it is an example of action that can be replaced by any other code.

Functions and Description

The Enums above are all default JU TPS Inputs that you can easily access with the above functions.

Example: float moveHorizontal = JUInput.GetAxis(JUInput.Axis.MoveHorizontal);

Custom Inputs

In the JU Input Manager you can create custom inputs and call it normally, first create a Custom Input:

Note that the "Custom Button" only works in the Old Input System, if you want to check inputs in the new input system you can use Input Events Components

And you can call that input like this:

 //Check if Custom Button "SuperPower" was pressed
if (JUInput.GetCustomButtonDown("SuperPower") || JUInput.GetCustomTouchButtonDown("SuperPower"))
{
   Debug.Log("Pressed M");
}

See below all Custom Input Functions:

Rewrite Functions

These functions rewrite the Inputs, it is used by Mobile Rig to make the virtual buttons work.

Last updated