Interface MaterialComponentDefinitionExtended

Hierarchy

Properties

Texture: TextureHelper

Texture helpers with constructor

componentId: number
componentName: string
componentType: LastWriteWinElementSet
getFlat: ((entity: Entity) => ReadonlyFlatMaterial)

Type declaration

    • (entity: Entity): ReadonlyFlatMaterial
    • Get 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.

      Returns

      A readonly accessor object with direct access to material properties

      Parameters

      • entity: Entity

        Entity with the Material component

      Returns ReadonlyFlatMaterial

getFlatMutable: ((entity: Entity) => FlatMaterial)

Type declaration

    • (entity: Entity): FlatMaterial
    • 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.

      Returns

      A mutable accessor object with direct access to material properties

      Parameters

      • entity: Entity

        Entity with the Material component

      Returns FlatMaterial

getFlatMutableOrNull: ((entity: Entity) => null | FlatMaterial)

Type declaration

    • (entity: Entity): null | FlatMaterial
    • Get a mutable flattened accessor for the material's properties, or null if the entity does not have a Material component.

      Returns

      A mutable accessor object, or null if no Material component exists

      Parameters

      • entity: Entity

        Entity to check for Material component

      Returns null | FlatMaterial

getFlatOrNull: ((entity: Entity) => null | ReadonlyFlatMaterial)

Type declaration

    • (entity: Entity): null | ReadonlyFlatMaterial
    • Get a readonly flattened accessor for the material's properties, or null if the entity does not have a Material component.

      Returns

      A readonly accessor object, or null if no Material component exists

      Parameters

      • entity: Entity

        Entity to check for Material component

      Returns null | ReadonlyFlatMaterial

setBasicMaterial: ((entity: Entity, material: PBMaterial_UnlitMaterial) => void)

Type declaration

setPbrMaterial: ((entity: Entity, material: PBMaterial_PbrMaterial) => void)

Type declaration

Methods

  • Add the current component to an entity, throw an error if the component already exists (use createOrReplace instead).

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity that will be used to create the component

    • Optional val: PBMaterial

      The initial value

    Returns PBMaterial

  • Delete the current component to an entity, return null if the entity doesn't have the current component.

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity to delete the component from

    Returns null | PBMaterial

  • 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.

    Parameters

    • entity: Entity

      Entity ID that was deleted.

    • markAsDirty: boolean

    Returns void

  • Get the mutable component of the entity, throw an error if the entity doesn't have the component.

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity to get the component from

    Returns PBMaterial

  • Get the mutable component of the entity, return null if the entity doesn't have the component.

    • Internal comment: This method adds the <entity,component> to the list to be reviewed next frame

    Parameters

    • entity: Entity

      Entity to get the component from

    Returns null | PBMaterial