A resource managers that download and remember downloaded content for one kind of resource.

interface ResourceManager {
    dispose(): void;
    getResourceKinds(): ResourceKind[];
    loadResource(resourceName): Promise<void>;
    processResource(resourceName): Promise<void>;
    unloadResourcesList(resourcesList): void;
}

Implemented by

Methods

  • Should clear all resources, data, loaders stored by this manager. Using the manager after calling this method is undefined behavior.

    Returns void

  • Load the specified resource.

    This method will be run during the game. It should only do light tasks like file downloading.

    Parameters

    • resourceName: string

    Returns Promise<void>

  • Process the specified resource.

    This method will only be run while loading screen is shown. It can do heavy tasks like parsing data.

    Parameters

    • resourceName: string

    Returns Promise<void>

  • Should clear all specified resources data and anything stored by this manager for these resources.

    Usually called when scene resoures are unloaded.

    Parameters

    • resourcesList: ResourceData[]

      The list of specific resources that need to be clear

    Returns void