Options
All
  • Public
  • Public/Protected
  • All
Menu

Define a task used by AssetsManager to load assets into a container

Hierarchy

Index

Constructors

  • new ContainerAssetTask(name: string, meshesNames: any, rootUrl: string, sceneFilename: string | File, extension?: string): ContainerAssetTask
  • Creates a new ContainerAssetTask

    Parameters

    • name: string

      defines the name of the task

    • meshesNames: any

      defines the list of mesh's names you want to load

    • rootUrl: string

      defines the root url to use as a base to load your meshes and associated resources

    • sceneFilename: string | File

      defines the filename or File of the scene to load from

    • Optional extension: string

    Returns ContainerAssetTask

Properties

extension?: string

Defines the extension to use to load the scene (if not defined, ".babylon" will be used)

loadedAnimationGroups: AnimationGroup[]

Gets the list of loaded animation groups

loadedContainer: AssetContainer

Get the loaded asset container

loadedMeshes: AbstractMesh[]

Gets the list of loaded meshes

loadedParticleSystems: IParticleSystem[]

Gets the list of loaded particle systems

loadedSkeletons: Skeleton[]

Gets the list of loaded skeletons

loadedTransformNodes: TransformNode[]

Gets the list of loaded transforms

meshesNames: any

Defines the list of mesh's names you want to load

name: string

Defines the name of the task

onError: ((task: ContainerAssetTask, message?: string, exception?: any) => void)

Type declaration

    • Callback called when the task is successful

      Parameters

      Returns void

onSuccess: ((task: ContainerAssetTask) => void)

Type declaration

rootUrl: string

Defines the root url to use as a base to load your meshes and associated resources

sceneFilename: string | File

Defines the filename or File of the scene to load from

Accessors

  • get errorObject(): { exception?: any; message?: string }
  • Gets the current error object (if task is in error)

    Returns { exception?: any; message?: string }

    • Optional exception?: any
    • Optional message?: string
  • get isCompleted(): boolean
  • Get if the task is completed

    Returns boolean

  • Gets the current state of the task

    Returns AssetTaskState

Methods

  • reset(): void
  • Reset will set the task state back to INIT, so the next load call of the assets manager will execute this task again. This can be used with failed tasks that have the reason for failure fixed.

    Returns void

  • run(scene: Scene, onSuccess: (() => void), onError: ((message?: string, exception?: any) => void)): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: (() => void)

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: ((message?: string, exception?: any) => void)

      is a callback called if an error occurs

        • (message?: string, exception?: any): void
        • Parameters

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

  • runTask(scene: Scene, onSuccess: (() => void), onError: ((message?: string, exception?: any) => void)): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: (() => void)

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: ((message?: string, exception?: any) => void)

      is a callback called if an error occurs

        • (message?: string, exception?: any): void
        • Parameters

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method

Settings

Theme