Instantiate(WorldUnmanaged, Entity)
Clones an entity from any world into the given world.
Read time 1 minuteLast updated 2 days ago
Definition
- Type: Method
- Namespace: Unity.Entities
- Assembly: UnityEngine.EntitiesModule
public static Entity Instantiate(WorldUnmanaged dstWorld, Entity srcEntity)
Parameters
The world to create the clone in.
The entity to clone, in any world.
Returns
Type | Description |
|---|---|
| Entity | The clone, in |
Remarks
The clone has the same components and values as the source, without Prefab and cleanup components. If the source has a LinkedEntityGroup, the whole group is cloned, and references between the cloned entities point at the clones.
When is in another world, references to entities outside the group become Entity.Null, because they point into the source world.
srcEntityThis is a structural change in . Instantiating from another world also completes the source world's jobs that write to the components being cloned.
dstWorld