ResourceManager is a singleton class providing a central access point for external resources and their disposal,
such as meshes, materials, etc, while taking care of loading transparently, when needed.
instance:ResourceManager
[read-only]
Gets the singleton instance of the ResourceManager.
Implementation
public static function get instance():ResourceManager
public function clearResource(resource:IResource):void
Clears the memory used by a resource, including all of its dependencies.
Parameters
| resource:IResource — The resource to be cleared.
|
public function getResource(uri:String, ignoreDependencies:Boolean = false, parser:Class = null):IResource
Retrieve the resource at the given url. Loading and parsing is only performed on the first time for the url,
and if not cleared.
Parameters
| uri:String — The url or id of the resource to be retrieved. If not parsed before, it should be a url.
|
|
| ignoreDependencies:Boolean (default = false ) — Indicates whether or not dependencies should be ignored or loaded.
|
|
| parser:Class (default = null ) — An optional parser object that will translate the data into a usable resource.
|
Returns
| IResource —
A handle to the retrieved resource.
|
public function parseData(data:*, id:String, ignoreDependencies:Boolean = true, parser:Class = null):IResource
Retrieves the resource parsed from the given data.
Parameters
| data:* — The data to be parsed.
|
|
| id:String — The id that will be assigned to the resource. This can later also be used by the getResource method.
|
|
| ignoreDependencies:Boolean (default = true ) — Indicates whether or not dependencies should be ignored or loaded.
|
|
| parser:Class (default = null ) — An optional parser object that will translate the data into a usable resource.
|
Returns
| IResource —
A handle to the retrieved resource.
|