Michsky – Docs Michsky – Docs
  • Home 
  • Documentation 
    • Hex UI 
    • Beam UI 
    • Reach UI 
    • Heat UI 
    • DreamOS 
    • Modern UI Pack 
    • Loading Screen Studio 
    • Dark UI 
    • Motion Titles Pack 
  • Contact 
Michsky – Docs Michsky – Docs
Michsky – Docs
  • Home 
  • Documentation 
    • Hex UI 
    • Beam UI 
    • Reach UI 
    • Heat UI 
    • DreamOS 
    • Modern UI Pack 
    • Loading Screen Studio 
    • Dark UI 
    • Motion Titles Pack 
  • Contact 

Hex UI

  • Quick Start
  • Animations
  • Controller & Input
    • Controller Manager
    • Controller Presets
    • Hotkey Event
    • UI Navigation
  • Handlers & Managers
    • Audio
    • Chapters
    • Credits
    • Effects
    • In-Game
  • Localization
    • Getting Started
    • Localization Settings
    • Localization Manager
    • Localized Object
  • UI Elements
    • Button
    • Dropdown
    • Modal Window
    • Notifications
    • Panel Manager
    • Progress Bar
    • Selectors
    • Slider
    • Switch
    • Timer
    • Widgets
    • Others
  • UI Manager
  • Others & Add-ons
  • FAQs
  1. Home
  2. Hex UI
  3. Controller & Input
  4. Controller Manager
Updated on May 19, 2024

Hex UI

  • Quick Start
  • Animations
  • Controller & Input
    • Controller Manager
    • Controller Presets
    • Hotkey Event
    • UI Navigation
  • Handlers & Managers
    • Audio
    • Chapters
    • Credits
    • Effects
    • In-Game
  • Localization
    • Getting Started
    • Localization Settings
    • Localization Manager
    • Localized Object
  • UI Elements
    • Button
    • Dropdown
    • Modal Window
    • Notifications
    • Panel Manager
    • Progress Bar
    • Selectors
    • Slider
    • Switch
    • Timer
    • Widgets
    • Others
  • UI Manager
  • Others & Add-ons
  • FAQs

Controller Manager

Author: admin 71 views

The core component that manages all gamepad related custom inputs and events.

Manager Workflow

Controller Manager adapts the UI layout to the active controller (e.g. Xbox controller) and invokes custom events. It is dynamic and also supports custom controller presets that do not come out of the box (e.g. Joycon). Xbox, DualSense and keyboard/mouse is supported out of the box.

You can click here to learn how to add new custom controllers.

Properties

Property Type Function
presetManager
ControllerPresetManager

Stores the supported controller preset list.

gamepadObjects
List<gameObject>

Objects in this list will be enabled when the gamepad is plugged.

keyboardObjects
List<gameObject>

Objects in this list will be enabled when the gamepad is un-plugged.

alwaysUpdate
bool

Check for input changes each frame.

affectCursor
bool

Set cursor visibility based on the controller state.

gamepadHotkey
InputAction

Used to activate the gamepad when both keyboard/mouse and gamepad connected at the same time.

Scripting

				
					using UnityEngine;
using Michsky.UI.Hex; // Namespace

public class SampleClass : MonoBehaviour
{
    [SerializeField] private ControllerManager controllerManager;

    void Start()
    {
        // Change the UI on controller change
        controllerManager.alwaysUpdate = true;

        // Set cursor state on controller change
        controllerManager.affectCursor = true;

        // Add a new gamepad/keyboard specific object
        controllerManager.gamepadObjects.Add(gameObject);
        controllerManager.keyboardObjects.Add(gameObject);

        // Get data
        Debug.Log(controllerManager.currentController); // Current controller name
        Debug.Log(controllerManager.gamepadConnected); // Is gamepad connected
        Debug.Log(controllerManager.gamepadEnabled); // Is gamepad enabled
    }
}
				
			

How can we help?

A premium WordPress theme with an integrated Knowledge Base,
providing 24/7 community-based support.

© 2024 Michsky