Sets the resource. You can either set resources one-by-one which can be useful to add them throughout your application at various times or as a collection.
NOTE: You can also leverage the constants
from the instance for valid string values.
Example
// can leverage constants
const C = $$$.constants;
$$$.setResource(C.C, camera); // camera being a THREE.js camera instance
$$$.setResource('renderer', renderer); // camera being a THREE.js renderer instance
$$$.setResource('scene', scene); // camera being a THREE.js scene instance
// or you can set all at once
$$$.setResource({
camera,
renderer,
scene
});
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
key |
string | object | The resource name or an Properties
|
|||||||||||||||||
value |
object |
<optional> |
The resource value or it's optional if first argument is an |
Returns:
- Chainable api by returning the instance.
- Type
- self