Instance Method

didClone(from:)

Tells a newly cloned entity that cloning is complete.

Declaration

func didClone(from source: Entity)

Parameters

source

The entity from which the cloned entity was copied.

Discussion

This method clones all component data automatically. When you clone an entity that stores custom data that’s not part of a component, override the didClone(from:) method to copy that data manually after the clone finishes.

See Also

Creating an Entity

init()

Creates a new entity.

func clone(recursive: Bool) -> Self

Duplicates an entity to create a new entity.