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 InputJSONNodeWriter

    Serializes a InputJSONNode tree back to JSON text, matching the formatting Unity's own serializer produces for input action assets.

    Inheritance
    object
    InputJSONNodeWriter
    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 static class InputJSONNodeWriter
    Remarks

    Unity writes action assets with JsonUtility.ToJson(value, prettyPrint: true), which produces a four-space indent, a single space after each colon, LF newlines, inline [] for empty arrays, and no trailing newline. Reproducing that exactly is what lets a Scylla save of an unmodified asset leave version control untouched.

    Two details are easy to get wrong. The Core writer's indent can only be changed through Scylla.Core.Util.Serialization.ScyllaJSONWriter.Configure(Scylla.Core.Util.Serialization.SerializationSettings); calling SetPrettyPrint(bool) alone leaves the default tab. And numbers are emitted through WriteRawValue(string) from their stored source text, because rendering a parsed value back would turn 1.0 into 1 and would depend on the current culture.

    Fields

    UNITY_INDENT

    The indent Unity's pretty-printed JSON uses: four spaces per nesting level. The Core writer defaults to a tab, so this must be applied explicitly.

    Declaration
    public const string UNITY_INDENT = "    "
    Field Value
    Type Description
    string

    Methods

    Write(InputJSONNode)

    Serializes a tree using Unity's pretty-print formatting.

    Declaration
    public static string Write(InputJSONNode root)
    Parameters
    Type Name Description
    InputJSONNode root

    The root node.

    Returns
    Type Description
    string

    The JSON text, with no trailing newline.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when the root is null.

    Write(InputJSONNode, bool, string)

    Serializes a tree with explicit formatting control.

    Declaration
    public static string Write(InputJSONNode root, bool prettyPrint, string indent)
    Parameters
    Type Name Description
    InputJSONNode root

    The root node.

    bool prettyPrint

    true to emit newlines and indentation, false for compact output.

    string indent

    The string repeated once per nesting level. Ignored when not pretty-printing.

    Returns
    Type Description
    string

    The JSON text, with no trailing newline.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when the root is null.

    WriteBytes(InputJSONNode)

    Serializes a tree using Unity's formatting and returns UTF-8 bytes with no byte order mark.

    Declaration
    public static byte[] WriteBytes(InputJSONNode root)
    Parameters
    Type Name Description
    InputJSONNode root

    The root node.

    Returns
    Type Description
    byte[]

    The UTF-8 encoded JSON text.

    Remarks

    Prefer this over encoding the string yourself when writing to disk. Unity's action assets carry no byte order mark, and the framework's text-writing helper emits one by default, so going through bytes avoids a corrupt first line.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown when the root is null.

    See Also

    InputJSONNode
    InputJSONNodeReader
    In this article
    Back to top Scylla Framework - Input Module API Documentation