Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Input
      • AutoResolveChange
      • AutoResolveResult
      • BindingConflict
      • BindingStorageSettings
      • BindingStorageType
      • BridgeSettings
      • BufferedInput
      • ConfigActionEntry
      • ConfigActionGroup
      • ConfigBindingEntry
      • ConfigConflict
      • ConfigGroupExclusion
      • ConfigLayout
      • ConfigLayout.Builder
      • ConfigLayoutColumnDefinition
      • ConfigLayoutConflictScope
      • ConfigLayoutDefinition
      • ConfigLayoutExclusionDefinition
      • ConfigLayoutGroupDefinition
      • ConfigLayoutGroupMode
      • ConfigLayoutMemberReference
      • ConfigLayoutValidationMessage
      • ConfigLayoutValidationSeverity
      • ConfigSchemeGroup
      • ContextConflictScope
      • ContextValidationMessage
      • ContextValidationSeverity
      • ControlScheme
      • ControlSchemeChangedEvent
      • ControlSchemeManager
      • ControlSchemeType
      • GamepadButton
      • GamepadType
      • IBindingStorage
      • IControlSchemeManager
      • IInputActionManager
      • IInputBindingManager
      • IInputBridgeManager
      • IInputBufferManager
      • IInputConflictScope
      • IInputContextManager
      • IInputControlAliasResolver
      • IInputHintsManager
      • IInputListener
      • IInputRebindabilityProvider
      • IScyllaInputBridge
      • IdentityControlAliasResolver
      • InputActionCanceledEvent
      • InputActionManager
      • InputActionMapNode
      • InputActionMetadata
      • InputActionNode
      • InputActionPerformedEvent
      • InputActionStartedEvent
      • InputActionsDocument
      • InputActionsDocumentIO
      • InputActionsJSONKeys
      • InputAnnotation
      • InputAssetInfo
      • InputBindingGroups
      • InputBindingManager
      • InputBindingMetadata
      • InputBindingNode
      • InputBindingsLoadedEvent
      • InputBindingsSavedEvent
      • InputBridgeManager
      • InputBridgeQueryMode
      • InputBufferConsumedEvent
      • InputBufferManager
      • InputBufferedEvent
      • InputCodegenSettings
      • InputCompositeUtil
      • InputConflictEngine
      • InputConflictPair
      • InputConflictPolicy
      • InputConflictReason
      • InputConflictRecord
      • InputConflictRecordBuilder
      • InputConflictResolution
      • InputConflictSet
      • InputContext
      • InputContextChangedEvent
      • InputContextDefinition
      • InputContextExclusivity
      • InputContextManager
      • InputContextPoppedEvent
      • InputContextPushedEvent
      • InputControlAliasEntry
      • InputControlAliasResolver
      • InputControlAliasScope
      • InputControlPathUtil
      • InputControlSchemeNode
      • InputDeviceChangedEvent
      • InputDeviceConnectedEvent
      • InputDeviceDisconnectedEvent
      • InputDeviceType
      • InputDeviceUtil
      • InputDisabledEvent
      • InputEnabledEvent
      • InputEventType
      • InputHint
      • InputHintChangedEvent
      • InputHintsManager
      • InputIconSet
      • InputIconSet.IconMapping
      • InputIconSetChangedEvent
      • InputInteractionKind
      • InputInteractionResolver
      • InputInteractionSignature
      • InputJSONMember
      • InputJSONNode
      • InputJSONNodeReader
      • InputJSONNodeType
      • InputJSONNodeWriter
      • InputLoggingSettings
      • InputMapMetadata
      • InputMetadataRebindabilityProvider
      • InputMetadataReconciler
      • InputMetadataRecordKind
      • InputModifierMetadataUtil
      • InputOrphanRecord
      • InputRebindCancelledEvent
      • InputRebindCompletedEvent
      • InputRebindManager
      • InputRebindOperation
      • InputRebindStartedEvent
      • InputRebindUtils
      • InputRebindability
      • InputReconcileAction
      • InputReconcileOptions
      • InputReconcileReport
      • InputReconcileReport.Entry
      • InputSchemeDeviceNode
      • InputSchemeMetadata
      • JSONFileBindingStorage
      • ManagedRebindCancelledEvent
      • ManagedRebindCompletedEvent
      • ManagedRebindDataRefreshedEvent
      • ManagedRebindStartedEvent
      • PlayerPrefsBindingStorage
      • RebindMode
      • RebindSettings
      • ScyllaInput
      • ScyllaInput.Meta
      • ScyllaInputAction
      • ScyllaInputActionMap
      • ScyllaInputActionsMetadata
      • ScyllaInputActionsMetadataMigrator
      • ScyllaInputBinding
      • ScyllaInputConfiguration
      • ScyllaInputContextConfiguration
      • ScyllaKey
      • ScyllaKeyConverter
      • ScyllaModifier
      • UnityInputSystemBridge
    • Scylla.Input.Editor
      • DeviceStatusWidget
      • IconMappingDrawer
      • InputIconSetEditor
      • ScyllaInputActionsMetadataEditor
      • ScyllaInputConfigurationEditor
      • ScyllaInputContextConfigurationEditor
      • ScyllaInputDependencyProvider
      • ScyllaInputEditor
      • ScyllaInputGameProfile
      • ScyllaInputGameProfiles
      • ScyllaInputMenuItems
      • ScyllaInputWizard

    Class PlayerPrefsBindingStorage

    An IBindingStorage implementation that persists input binding overrides using Unity's PlayerPrefs registry.

    Inheritance
    object
    PlayerPrefsBindingStorage
    Implements
    IBindingStorage
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.Input
    Assembly: ScyllaInput.dll
    Syntax
    public class PlayerPrefsBindingStorage : IBindingStorage
    Remarks

    This is the default storage backend created by InputBindingManager during Initialize(IInputActionManager, IInputContextManager) when no custom backend has been configured via SetStorage(IBindingStorage).

    Key scheme: each profile's JSON payload is stored under a PlayerPrefs key with the prefix Scylla.Input.Bindings. followed by the profile ID (e.g., Scylla.Input.Bindings.default). A separate key, Scylla.Input.Bindings._profiles, holds a comma-separated list of all known profile IDs and is maintained automatically as profiles are created or deleted.

    Profile tracking: because PlayerPrefs does not support key enumeration, the class maintains an in-memory HashSet<string> of known profiles that is persisted separately as the profile-list key. This list is loaded from PlayerPrefs on construction. Profile IDs are trimmed of whitespace when parsed from the stored list.

    Platform considerations: PlayerPrefs data is stored in the platform registry or a local preferences file (location varies by platform). Data is durable across play sessions and application reinstalls on most platforms. The size of an individual binding JSON payload contributes to the total PlayerPrefs storage used by the application. For games with very large input schemas or many profiles, consider JSONFileBindingStorage instead.

    Every SaveBindings(string, string) and DeleteBindings(string) call that modifies state ends with PlayerPrefs.Save() to flush changes to disk immediately, guarding against data loss if the application exits unexpectedly.

    Constructors

    PlayerPrefsBindingStorage()

    Initializes a new PlayerPrefsBindingStorage and loads the list of previously saved profiles from PlayerPrefs.

    Declaration
    public PlayerPrefsBindingStorage()

    Properties

    StorageID

    Gets a short, human-readable identifier that names this storage backend.

    Declaration
    public string StorageID { get; }
    Property Value
    Type Description
    string

    A non-null, non-empty string that uniquely identifies the backend, such as "PlayerPrefs" or "JSONFile". Used primarily for diagnostic logging.

    Methods

    DeleteBindings(string)

    Permanently removes the saved binding data for the given profile.

    Declaration
    public bool DeleteBindings(string profileID)
    Parameters
    Type Name Description
    string profileID

    The non-null, non-empty string that identifies the profile to delete.

    Returns
    Type Description
    bool

    true if the profile existed and was successfully removed; false if the profile did not exist, profileID is null or empty, or an I/O error prevented deletion.

    GetAllProfiles()

    Returns the identifiers of every profile that currently has saved binding data in this storage backend.

    Declaration
    public IReadOnlyList<string> GetAllProfiles()
    Returns
    Type Description
    IReadOnlyList<string>

    A non-null, read-only list of profile ID strings. The list is empty if no profiles have been saved or if the backend cannot enumerate them. The order of entries is implementation-defined.

    HasBindings(string)

    Determines whether saved binding data exists for the given profile.

    Declaration
    public bool HasBindings(string profileID)
    Parameters
    Type Name Description
    string profileID

    The profile identifier to check. Returns false immediately if null or empty.

    Returns
    Type Description
    bool

    true if a saved entry for profileID exists in the backend storage; false otherwise. This method does not validate the content of the stored data, only that an entry is present.

    LoadBindings(string)

    Retrieves the previously saved JSON binding data for the given profile.

    Declaration
    public string LoadBindings(string profileID)
    Parameters
    Type Name Description
    string profileID

    The non-null, non-empty string that identifies the profile slot to read from.

    Returns
    Type Description
    string

    The raw JSON string that was passed to SaveBindings(string, string) for this profile, or null if no data has been saved for profileID or if an I/O error occurred while reading.

    SaveBindings(string, string)

    Persists the supplied JSON binding data under the given profile identifier.

    Declaration
    public void SaveBindings(string profileID, string jsonData)
    Parameters
    Type Name Description
    string profileID

    The non-null, non-empty string that names the profile slot to write into (for example "default" or "player2"). If the profile already exists its previous data is overwritten.

    string jsonData

    The JSON string produced by ExportBindingsAsJSON(). Must not be null or empty; implementations should log a warning and return early if it is.

    Remarks

    Implementations are expected to handle I/O failures gracefully - logging the error and returning without propagating an exception to the caller.

    Implements

    IBindingStorage

    See Also

    JSONFileBindingStorage
    IBindingStorage
    In this article
    Back to top Scylla Framework - Input Module API Documentation