Skip to content
API referenceDevelopmentEngine APIEngine ccf7d03f
Synced

SceneElementSerialization.RestoreComponent

Section titled “SceneElementSerialization.RestoreComponent”
  • Recreates one component without invoking Reset and restores its persistent properties.

API: engine
Project: Inno.Scene

public static Inno.Scene.GameComponent Inno.Scene.SceneElementSerialization.RestoreComponent(Inno.Scene.GameObject owner, Inno.Extensibility.Types.TypeRef type, System.Guid persistentId, int componentIndex, System.ReadOnlySpan<byte> stateData, Inno.Core.Serialization.SerializationRegistry serialization, Inno.Assets.IAssetReferenceResolver assets)

Parameter owner: The live GameObject that will own the component.

Parameter type: The reload-safe identity of the current component implementation.

Parameter persistentId: The component instance identity to preserve.

Parameter componentIndex: The requested attachment index.

Parameter stateData: Complete neutral element bytes produced by CaptureState, including missing-state metadata.

Parameter serialization: The serialization registry that owns the active converter generation.

Parameter assets: The resolver used to materialize canonical asset references in restored properties.

The recreated component, or a preserved missing placeholder when its logical type is unavailable.

Exception T:System.ArgumentNullException: Thrown when owner is null.

Exception T:System.IO.InvalidDataException: Thrown when the payload is invalid or the stable type resolves to an incompatible component.

Exception T:System.InvalidOperationException: Thrown when the identity or component multiplicity conflicts, property restoration is incomplete, or a failed restoration cannot remove its partially created component.