Struct MigrationDescription<TVersion, TTarget>
Describe migration steps to perform when upgrading from one version of an object to another.
Namespace: UnityEngine.Rendering.HighDefinition
Syntax
public struct MigrationDescription<TVersion, TTarget>
where TVersion : struct, IConvertible where TTarget : class, IVersionable<TVersion>
Type Parameters
Name | Description |
---|---|
TVersion | An enum identifying the version. |
TTarget | The type to migrate. |
Constructors
MigrationDescription(MigrationStep<TVersion, TTarget>[])
Build a migration description.
Declaration
public MigrationDescription(params MigrationStep<TVersion, TTarget>[] steps)
Parameters
Type | Name | Description |
---|---|---|
MigrationStep<TVersion, TTarget>[] | steps | The step to follow between each version migration. |
Methods
ExecuteStep(TTarget, TVersion)
Execute a migration step.
Declaration
public void ExecuteStep(TTarget target, TVersion stepVersion)
Parameters
Type | Name | Description |
---|---|---|
TTarget | target | Target. |
TVersion | stepVersion | Step version. |
Migrate(TTarget)
Execute the migration on the provided instance.
All steps with a version greater than the instance version will be executed in ascending order. Eg: for instance with version 2 and step version 1, 3, 5, and 6. It will execute steps 3 then 5 then 6.
Declaration
public bool Migrate(TTarget target)
Parameters
Type | Name | Description |
---|---|---|
TTarget | target | The instance to migrate. |
Returns
Type | Description |
---|---|
Boolean | True if it has executed migration steps, false otherwise. |