InputBindingStore

Reads and writes a player's rebindings as a small JSON file beside the game's other user data: paths keyed by Map/Action/index, exactly what CaptureOverrides produces.

Remarks

The file is a convenience, never a requirement: an unreadable one, or an entry naming an action the asset no longer has, is discarded and the authored binding stands.

Public Methods

DefaultPath

public static string DefaultPath(string productName)

The file a game stores its rebindings in, under the user's application data.

Parameters:

  • productName (string): The folder the game keeps its user data in.

Returns: string

  • An absolute path.

Save

public static bool Save(InputActionService service, string path)

Writes the service's current bindings.

Parameters:

  • service (InputActionService): The service whose bindings are captured.
  • path (string): The file to write.

Returns: bool

  • True when the file was written.

Load

public static bool Load(InputActionService service, string path)

Restores stored bindings onto the service's loaded asset.

Parameters:

  • service (InputActionService): The service to apply them to.
  • path (string): The file to read.

Returns: bool

  • True when a file was read and applied.