Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T

Hierarchy

Index

Constructors

constructor

  • new Loader(_loaderType?: string): Loader

Properties

__agentConstructor

__agentConstructor: Function

Protected library

library: Map<string, T> = new Map<string, T>()

loaderType

loaderType: string

Protected resourcesRaw

resourcesRaw: Array<ResourceRaw> = []

Methods

addResources

getResource

  • getResource<C>(name: string, _throwWarning?: boolean): C
  • USE THIS FUNCTION TO GET READY RESOURCES

    Type parameters

    • C: T

    Parameters

    • name: string

      string Resource name to get

    • Default value _throwWarning: boolean = true

      boolean

    Returns C

    resource with the provided name, or undefined if none was found

load

  • load(): Promise<void>

Protected resourceToPromise

  • resourceToPromise(url: string, name: string): Promise<T>
  • MODIFY THIS IN EXTENDED CLASS TO LOAD RESOURCES PROPERLY You can look for ModelsLoader|AudiosLoader|FontsLoader and find an example there

    Parameters

    • url: string

      string path that leads to the file

    • name: string

      string resource name to set

    Returns Promise<T>

    resource Promise with new resource

Protected setResource

  • setResource(name: string, resource: T): void
  • Parameters

    • name: string

      string Resource name to set

    • resource: T

      to set to library of loaded resources

    Returns void

    resource with the provided name, or undefined if none was found

Legend

  • Namespace
  • Object literal
  • Variable
  • Function
  • Type alias
  • Type alias with type parameter
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Protected property
  • Protected method
  • Enumeration
  • Interface

Generated using TypeDoc