Returns the matching resource given the resource name. The returned resource is a node with attached node methods.
NOTE: 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 resource name. |
Returns:
- An array of matching nodes.
- Type
- node | false