Class DriverMigrationSystem
Namespace: Unity.NetCode
Syntax
public class DriverMigrationSystem : SystemBase
Methods
LoadWorld(Int32, World)
Loads a stored NetworkDriver and Connection data into a new or existing World.
Declaration
public World LoadWorld(int ticket, World newWorld = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | ticket | A ticket to a stored World |
| World | newWorld | An optional world we would want to Load into. |
Returns
| Type | Description |
|---|---|
| World | A prepared world that is ready to have its systems added. |
Remarks
This function needs to be called before any systems are initialized on the world we want to migrate to.
OnCreate()
Declaration
protected override void OnCreate()
OnDestroy()
Declaration
protected override void OnDestroy()
OnUpdate()
Declaration
protected override void OnUpdate()
StoreWorld(World)
Stores NetworkDriver and Connection data for migration of a specific world.
Declaration
public int StoreWorld(World sourceWorld)
Parameters
| Type | Name | Description |
|---|---|---|
| World | sourceWorld | The world we want to store. |
Returns
| Type | Description |
|---|---|
| Int32 | A ticket that can be used to retrieve the stored NetworkDriver data. |
Remarks
Only entities with the type NetworkStreamConnection are migrated over to the new World.