Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Git_CustomInputShowcase

🎮 Custom Input System for Unity

Unity License: MIT Platform Encryption

A modular, scalable, and secure input management system built on top of Unity’s Input System package.
Supports dynamic rebinding, encrypted save files, and a fully featured settings menu with minimal setup.


⚠️ Note: This repository is a showcase version of the full Custom Input System.
For the complete package (including prefabs, encryption, and full UI), check out the Unity Asset Store version.

✨ Features

  • 🔒 Secure – Encrypted local storage for all user data
  • 📈 Scalable – Automatically adapts to any number of Action Maps and Actions
  • 👨‍💻 Developer-Friendly – Minimal setup, drag-and-drop prefabs, no coding required
  • 🎮 Player-Friendly – Flexible rebinding, reset options, duplicate detection, and autosave
  • Modular Design – Core system + helper classes that work seamlessly together
  • 🛠 Customizable – Configure which inputs can/can’t be rebound (e.g., mouse delta, scroll wheel)

📂 File Storage Location

The system saves encrypted configuration files to Unity’s persistent data path.

📍 Windows Location
  1. Press Win + R
  2. Type %appdata% and press Enter
  3. Navigate one folder up to the AppData directory
  4. Go to:

AppData/LocalLow/DefaultCompany//

Inside this folder, you’ll find:

  • DefaultKeybinds.dat – Default bindings (created at first launch)
  • SettingsConfig.dat – User preferences (custom keybinds, audio, general settings, etc.)

Both files are encrypted by default to prevent tampering.


🏗 System Architecture

flowchart TD A[Settings UI
(Settings Manager)] --> B[Custom Input System
(Singleton Core)] B --> C[Player Input
(InputActionMapAssets)] B --> D[Rebinding Manager
(Validates + Assigns)] B --> E[Keycode Collection
(Caches Active Bindings)] B --> F[Input Manager
(Captures Input Events)]

Settings Manager Handles reading/writing encrypted files and manages the settings UI.

Custom Input System (Singleton) Core controller, globally accessible, persists across all scenes.

Helper Classes

Player Input – Holds InputActionMapAssets, detects raw input events

Keycode Collection – Stores active/default bindings + rebinding resets

Rebinding Manager – Prevents duplicate keys, manages single or full resets

Input Manager – Processes runtime input events, based on current Action Map

⚙️ Setup Guide

Step 1: Prepare Input Assets

Create and configure your InputActionMapAssets with the required action maps and actions.

Step 2: Add Prefabs

Drag the InputSystemManager prefab into your scene.

Drag the SettingsManager prefab into your scene.

Step 3: Configure Settings Manager

Assign references:

Action Map Button Prefab

Keybind Prefab

Buttons (Apply, Reset, AutoSave)

Link your InputActionMapAssets in the Input Asset field.

Step 4: Open Settings Menu

Use the SettingsManager instance at runtime.

// Example: Open settings when Pause is pressed if (CustomInput.Instance.Input.GetButtonDown("Pause")) { SettingsManager.Instance.OpenSetting(); }

📖 Example Demo Script

using UnityEngine; using StarVerestaInputSystem; using TMPro;

public class DemoScript : MonoBehaviour { [SerializeField] private string InteractionHash; [SerializeField] private TextMeshProUGUI interactionPressed; [SerializeField] private TextMeshProUGUI interactionHold; [SerializeField] private TextMeshProUGUI interactionReleased;

private float pressedTimer;
private float releasedTimer;
private const float latchDuration = 0.2f;

void Update()
{
    if (CustomInput.Instance.Input.GetButtonDown("Pause"))
    {
        SettingsManager.Instance.OpenSetting();
    }

    if (CustomInput.Instance.Input.GetButtonDown(InteractionHash))
        pressedTimer = latchDuration;

    if (CustomInput.Instance.Input.GetButtonUp(InteractionHash))
        releasedTimer = latchDuration;

    if (pressedTimer > 0) pressedTimer -= Time.deltaTime;
    if (releasedTimer > 0) releasedTimer -= Time.deltaTime;

    interactionPressed.text = $"{InteractionHash} Pressed: {pressedTimer > 0}";
    interactionReleased.text = $"{InteractionHash} Released: {releasedTimer > 0}";
    interactionHold.text = $"{InteractionHash} Holding: {CustomInput.Instance.Input.GetButton(InteractionHash)}";
}

}

🚀 Future Improvements

Enum-based action references (replace string lookups)

Improved cross-map duplicate detection

Additional encryption algorithms

Cloud save support

🤝 Contributing

Contributions, issues, and feature requests are welcome! Check the issues page or submit a pull request.

📜 License

Distributed under the MIT License. See LICENSE for details.


✅ This version is GitHub-optimized:

  • Professional tagline at the top
  • Badges for credibility
  • Mermaid system architecture diagram
  • Collapsible setup steps
  • Demo script nicely formatted
  • Screenshot placeholders
  • Polished license section

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages