ContainerAssetTask

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

Hierarchy

Index

Constructors

constructor

Find examples in Playground
  • new ContainerAssetTask(name: string, meshesNames: any, rootUrl: string, sceneFilename: string | File): 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

    Returns ContainerAssetTask

Properties

loadedAnimationGroups

Find examples in Playground
loadedAnimationGroups: Array<AnimationGroup>

Gets the list of loaded animation groups

loadedContainer

Find examples in Playground
loadedContainer: AssetContainer

Get the loaded asset container

loadedMeshes

Find examples in Playground
loadedMeshes: Array<AbstractMesh>

Gets the list of loaded meshes

loadedParticleSystems

Find examples in Playground
loadedParticleSystems: Array<IParticleSystem>

Gets the list of loaded particle systems

loadedSkeletons

Find examples in Playground
loadedSkeletons: Array<Skeleton>

Gets the list of loaded skeletons

meshesNames

Find examples in Playground
meshesNames: any

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

name

Find examples in Playground
name: string

Defines the name of the task

onError

Find examples in Playground
onError: function

Callback called when the task is successful

Type declaration

onSuccess

Find examples in Playground
onSuccess: function

Callback called when the task is successful

Type declaration

rootUrl

Find examples in Playground
rootUrl: string

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

sceneFilename

Find examples in Playground
sceneFilename: string | File

Defines the filename or File of the scene to load from

Accessors

errorObject

Find examples in Playground
  • get errorObject(): object
  • Gets the current error object (if task is in error)

    Returns object

    • Optional exception?: any
    • Optional message?: string

isCompleted

Find examples in Playground
  • get isCompleted(): boolean

taskState

Find examples in Playground

Methods

reset

Find examples in Playground
  • 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

Find examples in Playground
  • run(scene: Scene, onSuccess: function, onError: function): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: function

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: function

      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

Find examples in Playground
  • runTask(scene: Scene, onSuccess: function, onError: function): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: function

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: function

      is a callback called if an error occurs

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

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

Generated using TypeDoc