Returns the matching resource given the resource name. The returned resource is a node with attached node methods.
You can also leverage the constants
from the instance for valid string values.
Example
// returns the `camera` resource
$$$.getResource('camera');
// constants are useful to ensure the strings match
const C = $$$.constants;
// returns the `renderer` resource
$$$.getResource(C.RENDERER);
// returns false for invalid resources
$$$.getResource('INVALID');
Parameters:
Name | Type | Description |
---|---|---|
resourceName |
string | The name of for the resource. |
Returns:
- An array of matching nodes.
- Type
- node | false