Class UnityPlayerInputFactory
Factory for creating Unity PlayerInput components with configured input action assets.
Creates GameObject containers and adds PlayerInput components with proper action asset binding.
Provides standardized creation of input handlers for the player input system.
Implements
Inherited Members
Namespace: Serenity.InputGateway.Infrastructure.Factories
Assembly: Serenity.UnityPlayerInput.Infrastructure.dll
Syntax
public class UnityPlayerInputFactory : IPlayerInputFactory
Constructors
UnityPlayerInputFactory(InputActionAsset)
Initializes the factory with the input action asset to use for created PlayerInput components.
The action asset defines all available input actions and control schemes.
Declaration
public UnityPlayerInputFactory(InputActionAsset inputActionAsset)
Parameters
| Type | Name | Description |
|---|---|---|
| InputActionAsset | inputActionAsset | The input action asset to assign to created PlayerInput components. |
Methods
Create(string)
Creates a new PlayerInput component with the configured input action asset.
Sets up GameObject container and properly configures the component for input handling.
Declaration
public object Create(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name for the GameObject hosting the PlayerInput component. |
Returns
| Type | Description |
|---|---|
| object | The created PlayerInput component as an object. |