Class ScyllaInputActionsMetadata
Everything Scylla knows about an input action asset that the action asset itself cannot hold: authoring notes, protected-action flags, and the configuration screen layout.
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
[CreateAssetMenu(fileName = "New Input Actions Metadata", menuName = "Scylla/Input/Input Actions Metadata")]
public class ScyllaInputActionsMetadata : ScriptableObject
Remarks
This is a sidecar. The .inputactions stays a stock Unity file so any asset
authored in Unity's own editor opens here unchanged, and any asset authored here
still works with PlayerInput and Unity's generated wrapper. Scylla data cannot
live inside that file: InputActionAsset.ToJson() drops every member its
serialization structs do not declare, so anything embedded would be erased the first
time somebody saved from Unity's editor.
Records are keyed by the GUIDs the action asset already carries, with the element name cached alongside. A rename in either editor therefore keeps annotations attached with no user action, and a GUID regenerated by a merge can still be recovered by name. InputMetadataReconciler does that matching.
This lives in the runtime assembly rather than an editor one on purpose. A shipped controls screen has to read display-name overrides, protected flags and the authored layout with no editor code present, which is what makes this the asset that finally gives ConfigLayout an authoring surface.
It is a plain ScriptableObject and deliberately not a
ScyllaConfiguration. That base is for module settings: it would force a
ResetToDefaults that means nothing for per-asset authoring data, and would add
config-file build toggles to the Inspector that make no sense here.
Fields
ASSET_SUFFIX
Filename suffix convention, producing MyGame.scyllainput.asset beside
MyGame.inputactions. Discovery is by GUID, so this is a default rather than a
requirement and moving either file is safe.
Declaration
public const string ASSET_SUFFIX = ".scyllainput"
Field Value
| Type | Description |
|---|---|
| string |
ActionAssetGUID
The asset database GUID of the action asset this describes.
Declaration
[Header("Linked Action Asset")]
[Tooltip("Asset database GUID of the .inputactions this describes. Discovery is by GUID, so moving either file is safe.")]
public string ActionAssetGUID
Field Value
| Type | Description |
|---|---|
| string |
ActionAssetName
The action asset's name at last sync, for readable diffs and diagnostics.
Declaration
[Tooltip("The action asset's name at last sync.")]
public string ActionAssetName
Field Value
| Type | Description |
|---|---|
| string |
Actions
Per-action authoring data.
Declaration
public List<InputActionMetadata> Actions
Field Value
| Type | Description |
|---|---|
| List<InputActionMetadata> |
Bindings
Per-binding authoring data.
Declaration
public List<InputBindingMetadata> Bindings
Field Value
| Type | Description |
|---|---|
| List<InputBindingMetadata> |
CURRENT_SCHEMA_VERSION
The schema version this build writes.
Declaration
public const int CURRENT_SCHEMA_VERSION = 3
Field Value
| Type | Description |
|---|---|
| int |
Codegen
Where and how the constants file for this asset is generated.
Declaration
[Header("Codegen")]
public InputCodegenSettings Codegen
Field Value
| Type | Description |
|---|---|
| InputCodegenSettings |
ConfigLayout
The configuration screen layout, authored rather than hard-coded.
Declaration
[Header("Config Layout")]
public ConfigLayoutDefinition ConfigLayout
Field Value
| Type | Description |
|---|---|
| ConfigLayoutDefinition |
ContextConfiguration
The project's context configuration, referenced rather than absorbed so conflict exclusivity keeps exactly one declaration site.
Declaration
[Header("References")]
[Tooltip("The project's context configuration. Referenced, never copied: exclusivity is declared in exactly one place.")]
public ScyllaInputContextConfiguration ContextConfiguration
Field Value
| Type | Description |
|---|---|
| ScyllaInputContextConfiguration |
Info
What this action set is, named and described by its author. All fields optional.
Declaration
[Header("Info")]
public InputAssetInfo Info
Field Value
| Type | Description |
|---|---|
| InputAssetInfo |
LastSyncUTC
When the last reconciliation ran, in round-trip UTC form.
Declaration
[Tooltip("When the last reconciliation ran.")]
public string LastSyncUTC
Field Value
| Type | Description |
|---|---|
| string |
Maps
Per-map authoring data.
Declaration
[Header("Annotations")]
public List<InputMapMetadata> Maps
Field Value
| Type | Description |
|---|---|
| List<InputMapMetadata> |
Orphans
Records whose element could not be found, held aside rather than deleted.
Declaration
[Header("Quarantine")]
[Tooltip("Records whose element could not be found. Never purged automatically; a branch switch is the usual cause.")]
public List<InputOrphanRecord> Orphans
Field Value
| Type | Description |
|---|---|
| List<InputOrphanRecord> |
Schemes
Per-control-scheme authoring data.
Declaration
public List<InputSchemeMetadata> Schemes
Field Value
| Type | Description |
|---|---|
| List<InputSchemeMetadata> |
SchemesAreExclusive
Whether only one of this asset's control schemes is ever live at a time.
Declaration
[Header("Behavior")]
[Tooltip("Only one control scheme is live at a time, applied as a binding mask. Lets conflict detection ignore bindings that share a control under schemes with nothing in common.")]
public bool SchemesAreExclusive
Field Value
| Type | Description |
|---|---|
| bool |
Remarks
A statement about the game, not about the asset, which is why it has to be made by
hand. Unity applies a control scheme by setting a binding mask, and that only
happens if something asks for it: InputActionManager.SetActiveControlScheme,
Unity's own PlayerInput, or the project's own code. A project that simply
enables its action maps has every binding live at once regardless of which scheme
it names, and two schemes are then not exclusive at all.
Set, it lets conflict detection stop reporting two actions that share a control under schemes with nothing in common: three keyboard layouts each binding Right Shift to something different is the case it exists for. Bindings naming no scheme are unaffected, because a binding mask lets those through.
Defaults to false, and there is no migration step for it. An asset written
before this field existed deserializes it as false, which is exactly the
right answer: nothing about that asset said its schemes were exclusive, and
inferring it would switch off a correctness warning nobody asked to switch off.
Properties
SchemaVersion
Gets the schema version of the serialized data.
Declaration
public int SchemaVersion { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
FindAction(string)
Finds the record for an action.
Declaration
public InputActionMetadata FindAction(string actionID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The action's GUID. |
Returns
| Type | Description |
|---|---|
| InputActionMetadata | The record, or |
FindBinding(string)
Finds the record for a binding.
Declaration
public InputBindingMetadata FindBinding(string bindingID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bindingID | The binding's GUID. |
Returns
| Type | Description |
|---|---|
| InputBindingMetadata | The record, or |
FindMap(string)
Finds the record for a map.
Declaration
public InputMapMetadata FindMap(string mapID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The map's GUID. |
Returns
| Type | Description |
|---|---|
| InputMapMetadata | The record, or |
FindScheme(string)
Finds the record for a control scheme.
Declaration
public InputSchemeMetadata FindScheme(string schemeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | schemeName | The scheme name. |
Returns
| Type | Description |
|---|---|
| InputSchemeMetadata | The record, or |
GetOrCreateAction(string, string, string)
Gets the record for an action, creating it on first use.
Declaration
public InputActionMetadata GetOrCreateAction(string actionID, string mapID, string qualifiedName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | actionID | The action's GUID. |
| string | mapID | The owning map's GUID. |
| string | qualifiedName | The action's current |
Returns
| Type | Description |
|---|---|
| InputActionMetadata | The existing or newly created record. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the GUID is null or empty. |
GetOrCreateBinding(string, string, string)
Gets the record for a binding, creating it on first use.
Declaration
public InputBindingMetadata GetOrCreateBinding(string bindingID, string actionID, string qualifiedName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | bindingID | The binding's GUID. |
| string | actionID | The owning action's GUID. |
| string | qualifiedName | The binding's current qualified name. |
Returns
| Type | Description |
|---|---|
| InputBindingMetadata | The existing or newly created record. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the GUID is null or empty. |
GetOrCreateMap(string, string)
Gets the record for a map, creating it on first use.
Declaration
public InputMapMetadata GetOrCreateMap(string mapID, string qualifiedName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | mapID | The map's GUID. |
| string | qualifiedName | The map's current name. |
Returns
| Type | Description |
|---|---|
| InputMapMetadata | The existing or newly created record. |
Remarks
Records are created lazily rather than eagerly for every element in the asset. A record's existence then means somebody deliberately said something about that element, which keeps the asset small and its diff meaningful.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the GUID is null or empty. |
GetOrCreateScheme(string)
Gets the record for a control scheme, creating it on first use.
Declaration
public InputSchemeMetadata GetOrCreateScheme(string schemeName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | schemeName | The scheme name. |
Returns
| Type | Description |
|---|---|
| InputSchemeMetadata | The existing or newly created record. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the name is null or empty. |
InvalidateCache()
Marks the lookup dictionaries stale. Call after editing the record lists directly.
Declaration
public void InvalidateCache()
PruneEmptyRecords()
Drops records that carry no authored data, which accumulate when something is annotated and then cleared again.
Declaration
public int PruneEmptyRecords()
Returns
| Type | Description |
|---|---|
| int | The number of records removed. |
PurgeOrphan(string)
Discards the one quarantined record with the given identity.
Declaration
public bool PurgeOrphan(string recordID)
Parameters
| Type | Name | Description |
|---|---|---|
| string | recordID | The quarantined record's identity. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Matched on RecordID rather than the qualified name, because the name is
what went stale: two elements removed from the same map can be quarantined under
names that no longer distinguish them.
PurgeOrphans()
Discards every quarantined record. Destructive and never called automatically.
Declaration
public int PurgeOrphans()
Returns
| Type | Description |
|---|---|
| int | The number of records discarded. |