Unit Selection
  • Welcome
    • πŸ‘‹Hello
    • πŸ—ΊοΈRoadmap
    • ⛑️Support & Community
    • πŸŽ“Changelog
  • Getting started
    • πŸ”ŒImport package
    • πŸ› οΈAdd selection to scene
    • 🦲Add selection to units
    • β›³Add visuals to units
  • How it works
    • 🎯Active Selections
    • 🫡Unit Selector
    • πŸ”’Quick Access Selector
    • ⬛Selection Area
      • πŸ”²2D Rectangle
      • 🧊3D Cube
    • πŸ’ Selectable Unit
      • πŸ“Selection Bounds
      • β­•Selection Indicator
    • Selectable Group Unit
    • ⌨️Input Controls
    • πŸ‘·β€β™€οΈUnit Management
Powered by GitBook
On this page
  • Supported components
  • Customisation
  1. How it works

Input Controls

Learn how the input events are handled by the selection system.

The input control component is responsible for observing changes in the input system, invoking public Actions and updating it's state to reflect the input.

Supported components

For general use purposes there are two components provided by the package, one for the old input and one for the new input system.

  • InputActionsControl: This component is responsible for managing the new Input System interface

  • InputKeysControl: This component is responsible for managing the old Input interface

Customisation

Like everything in this package, you can implement your own input component with IInputControl interface, or extend your existing component with this interface.

public interface IInputControl
{
    public Action OnCancelTriggered { get; set; }
    public Action OnMouseDown { get; set; }
    public Action OnMouseUp { get; set; }
    public Vector3 MousePosition { get; }
    public Action<int> OnQuickSelectionToggle { get; set; }
    public bool IsMultiClickSelectionPressed { get; }
    public bool IsQuickSavePressed { get; }
}

Note: Additionally AInputControl is available, which is an abstract class implementing IInputControl, primarily as a convenience for connecting input reference through Unity's Editor and may be used instead of IInputControl.

PreviousSelectable Group UnitNextUnit Management

Last updated 1 year ago

⌨️