Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

addTrait

addTrait<S>(writer, target, trait, value?): void

Adds trait to target, with value over its defaults where given: an entity’s, or the world’s. The writer is as setTrait’s. A target that holds the trait already is refused, since koota would keep the old value and drop the new: setTrait changes it. As Unity’s EntityManager.AddComponent.

Type Parameter
S extends Schema
Parameter Type
writer EntityAuthority | PredictedStep
target PredictedEntity
trait PredictedTrait<S>
value? TraitValue<S>

void

addTrait<T>(writer, target, trait, value?): void

Adds trait to target, with value over its defaults where given: an entity’s, or the world’s. The writer is as setTrait’s. A target that holds the trait already is refused, since koota would keep the old value and drop the new: setTrait changes it. As Unity’s EntityManager.AddComponent.

Type Parameter
T extends UnstreamedTrait
Parameter Type
writer EntityAuthority | SystemStep
target Target
trait T
value? TraitValue<ExtractSchema<T>>

void

addTrait<T>(writer, target, trait, value?): void

Adds trait to target, with value over its defaults where given: an entity’s, or the world’s. The writer is as setTrait’s. A target that holds the trait already is refused, since koota would keep the old value and drop the new: setTrait changes it. As Unity’s EntityManager.AddComponent.

Type Parameter
T extends AnyEntityPredictedTrait
Parameter Type
writer PredictedStep
target PredictedEntity
trait T
value? TraitValue<ExtractSchema<T>>

void

addTrait<T>(writer, target, trait, value?): void

Adds trait to target, with value over its defaults where given: an entity’s, or the world’s. The writer is as setTrait’s. A target that holds the trait already is refused, since koota would keep the old value and drop the new: setTrait changes it. As Unity’s EntityManager.AddComponent.

Type Parameter
T extends Trait
Parameter Type
writer EntityAuthority
target Entity
trait T
value? TraitValue<ExtractSchema<T>>

void

addTrait<T>(writer, target, trait, value?): void

Adds trait to target, with value over its defaults where given: an entity’s, or the world’s. The writer is as setTrait’s. A target that holds the trait already is refused, since koota would keep the old value and drop the new: setTrait changes it. As Unity’s EntityManager.AddComponent.

Type Parameter
T extends Trait
Parameter Type
writer Authority
target World
trait T
value? TraitValue<ExtractSchema<T>>

void

addTrait<T>(writer, target, trait, value?): void

Adds trait to target, with value over its defaults where given: an entity’s, or the world’s. The writer is as setTrait’s. A target that holds the trait already is refused, since koota would keep the old value and drop the new: setTrait changes it. As Unity’s EntityManager.AddComponent.

Type Parameter
T extends Trait
Parameter Type
writer SetupWriter
target Target
trait T
value? TraitValue<ExtractSchema<T>>

void

addTrait<T>(writer, target, trait, value?): void

Adds trait to target, with value over its defaults where given: an entity’s, or the world’s. The writer is as setTrait’s. A target that holds the trait already is refused, since koota would keep the old value and drop the new: setTrait changes it. As Unity’s EntityManager.AddComponent.

Type Parameter
T extends LocalTrait
Parameter Type
writer ViewWriter | EntityAuthority | SystemStep
target Target
trait T
value? TraitValue<ExtractSchema<T>>

void