Entity.SetSameAs_T_(Entity).md

March 19, 2022 ยท View on GitHub

DefaultEcs

DefaultEcs.Entity

Entity.SetSameAs(Entity) Method

Sets the value of the component of type T on the current Entity to the same instance of an other Entity.
This method is not thread safe.

public void SetSameAs<T>(in DefaultEcs.Entity reference);

Type parameters

T

The type of the component.

Parameters

reference Entity

The other Entity used as reference.

Exceptions

System.InvalidOperationException
Entity was not created from a World.

System.InvalidOperationException
Reference Entity comes from a different World.

System.InvalidOperationException
Reference Entity does not have a component of type T.