setResource

rootComponents. setResource

Source:

Sets the resource to be consumed throughout tool. 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.

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
});