Class UnityUiController
Abstract base class for Unity UI controllers with input handling and directional navigation support.
Provides common functionality for UI navigation including hold direction timing and speed-up behavior.
Inheritance
UnityUiController
Assembly: Serenity.UnityUi.Infrastructure.dll
Syntax
public abstract class UnityUiController : UnityBaseController, IUiController<InputAction, InputAction.CallbackContext>, IController, IFoundationSettings
Constructors
UnityUiController()
Declaration
protected UnityUiController()
Fields
_consecutiveChangesBeforeSpeedUp
Declaration
protected int _consecutiveChangesBeforeSpeedUp
Field Value
_fastChangeInterval
Declaration
protected float _fastChangeInterval
Field Value
_holdingDirection
Declaration
protected Vector3 _holdingDirection
Field Value
_holdingDirectionTimerForNextChange
Declaration
protected float _holdingDirectionTimerForNextChange
Field Value
Declaration
protected ITimer _menuHoldDirectionTimer
Field Value
_timesChangedOptionOnHold
Declaration
protected int _timesChangedOptionOnHold
Field Value
Methods
Cancel()
Declaration
public abstract void Cancel()
CheckNavigation()
Declaration
protected void CheckNavigation()
ClearActions()
Declaration
protected void ClearActions()
GetTimer()
Gets the timer used for directional navigation hold behavior.
Provides access to the timer component that tracks navigation hold durations.
Declaration
Returns
| Type |
Description |
| ITimer |
The timer instance used for navigation timing
|
Initialize(string, string, float, int, float, IPlayerInputService, IPlayerInputActionBindingFactory<InputAction, CallbackContext>, IComponent, object, ILogService)
Initializes the UI controller with navigation timing and input handling configuration.
Sets up directional navigation behavior, hold timing, and speed-up mechanics for UI interaction.
Declaration
public virtual void Initialize(string id, string guid, float changeInterval, int consecutiveChangesBeforeSpeedUp, float fastChangeInterval, IPlayerInputService playerInputService, IPlayerInputActionBindingFactory<InputAction, InputAction.CallbackContext> playerInputActionBindingFactory, IComponent timer, object playerInput, ILogService logService)
Parameters
| Type |
Name |
Description |
| string |
id |
The unique identifier for the controller
|
| string |
guid |
The GUID for the controller instance
|
| float |
changeInterval |
The initial interval for navigation changes during hold
|
| int |
consecutiveChangesBeforeSpeedUp |
Number of changes before navigation speeds up
|
| float |
fastChangeInterval |
The faster interval used after speed-up threshold
|
| IPlayerInputService |
playerInputService |
The player input service for input management
|
| IPlayerInputActionBindingFactory<InputAction, CallbackContext> |
playerInputActionBindingFactory |
Factory for creating input action bindings
|
| IComponent |
timer |
The timer component for tracking hold durations
|
| object |
playerInput |
The player input instance
|
| ILogService |
logService |
The logging service for debugging
|
Initialize(string, string, float, int, float, IPlayerInputService, IPlayerInputActionBinding<InputAction, CallbackContext>, IComponent, object, string)
Declaration
public void Initialize(string id, string guid, float changeInterval, int consecutiveChangesBeforeSpeedUp, float fastChangeInterval, IPlayerInputService playerInputService, IPlayerInputActionBinding<InputAction, InputAction.CallbackContext> playerInputActionBinding, IComponent timer, object playerInput, string actionMapName)
Parameters
InitializeActions(string)
Declaration
protected override void InitializeActions(string actionMapName)
Parameters
| Type |
Name |
Description |
| string |
actionMapName |
|
IsMovingFast()
Declaration
protected bool IsMovingFast()
Returns
Navigate(Vector3)
Declaration
public abstract void Navigate(Vector3 direction)
Parameters
| Type |
Name |
Description |
| Vector3 |
direction |
|
ProcessNavigation(Vector3)
Declaration
protected virtual void ProcessNavigation(Vector3 direction)
Parameters
| Type |
Name |
Description |
| Vector3 |
direction |
|
RestartHoldDirectionTimer()
Declaration
protected void RestartHoldDirectionTimer()
Declaration
protected void SetCancelAction(InputAction inputAction)
Parameters
| Type |
Name |
Description |
| InputAction |
inputAction |
|
Declaration
protected void SetNavigateAction(InputAction inputAction)
Parameters
| Type |
Name |
Description |
| InputAction |
inputAction |
|
Declaration
protected void SetSubmitAction(InputAction inputAction)
Parameters
| Type |
Name |
Description |
| InputAction |
inputAction |
|
StartNewNavigation(Vector3)
Declaration
protected void StartNewNavigation(Vector3 direction)
Parameters
| Type |
Name |
Description |
| Vector3 |
direction |
|
Submit()
Declaration
public abstract void Submit()
createActionHandlers()
Declaration
protected Dictionary<string, Action<InputAction>> createActionHandlers()
Returns
createBindingsByAction()
Declaration
protected Dictionary<InputAction, IPlayerInputActionBinding<InputAction, InputAction.CallbackContext>> createBindingsByAction()
Returns
Implements