logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    UnityPlayerInputFactory
    Implements
    IPlayerInputFactory
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    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.

    Implements

    IPlayerInputFactory
    In this article
    © 2026 Serenity. All Rights Reserved