Readonly componentReadonly componentReadonly componentGet a readonly flattened accessor for the material's properties. Simplifies reading material properties without navigating nested unions. Works for both PBR and Unlit materials. Throws if the entity does not have a Material component.
A readonly accessor object with direct access to material properties
Entity with the Material component
Get a mutable flattened accessor for the material's properties. Simplifies reading/writing material properties without navigating nested unions. Works for both PBR and Unlit materials. Throws if the entity does not have a Material component.
A mutable accessor object with direct access to material properties
Entity with the Material component
Get a mutable flattened accessor for the material's properties, or null if the entity does not have a Material component.
A mutable accessor object, or null if no Material component exists
Entity to check for Material component
Get a readonly flattened accessor for the material's properties, or null if the entity does not have a Material component.
A readonly accessor object, or null if no Material component exists
Entity to check for Material component
Readonly schemaCreate or replace the component Material in the entity specified
the entity to link the component
the Unlit data for this material
Create or replace the component Material in the entity specified
the entity to link the component
the PBR data for this material
Add the current component to an entity, throw an error if the component already exists (use createOrReplace instead).
Entity that will be used to create the component
Optional val: PBMaterialThe initial value
Add the current component to an entity or replace the content if the entity already has the component
Entity that will be used to create or replace the component
Optional val: PBMaterialThe initial or new value
Delete the current component to an entity, return null if the entity doesn't have the current component.
Entity to delete the component from
This function writes the whole state of the component into a ByteBuffer
Optional filterEntity: ((entity: Entity) => boolean)Marks the entity as deleted and signals it cannot be used ever again. It must clear the component internal state, produces a synchronization message to remove the component from the entity.
Entity ID that was deleted.
Get the readonly component of the entity (to mutate it, use getMutable instead), throws an error if the entity doesn't have the component.
Entity that will be used to get the component
This function returns an iterable with all the CRDT updates that need to be broadcasted to other actors in the system. After returning, this function clears the internal dirty state. Updates are produced only once.
Get the mutable component of the entity, throw an error if the entity doesn't have the component.
Entity to get the component from
Get the mutable component of the entity, return null if the entity doesn't have the component.
Entity to get the component from
Get the mutable component of the entity. If the entity doesn't have the component, it's created.
Entity to get the component from
Optional initialValue: PBMaterialGet the readonly component of the entity (to mutate it, use getMutable instead), or null if the entity doesn't have the component.
Entity that will be used to try to get the component
Triggers the callback if the entity has changed on the last tick. If the value is undefined, the component was deleted.
This function receives a CRDT update and returns a touple with a "conflict resoluton" message, in case of the sender being updated or null in case of noop/accepted change. The second element of the touple is the modified/changed/deleted value.
Texture helpers with constructor