MCPcopy Index your code
hub / github.com/aframevr/aframe / registerSystem

Function registerSystem

src/core/system.js:125–155  ·  view source on GitHub ↗
(name, definition)

Source from the content-addressed store, hash-verified

123 * @param {object} definition - Component property and methods.
124 */
125export function registerSystem (name, definition) {
126 var i;
127 var NewSystem;
128 var proto = {};
129 var scenes = utils.findAllScenes(document);
130
131 // Format definition object to prototype object.
132 Object.keys(definition).forEach(function (key) {
133 proto[key] = {
134 value: definition[key],
135 writable: true
136 };
137 });
138
139 if (systems[name]) {
140 throw new Error('The system `' + name + '` has been already registered. ' +
141 'Check that you are not loading two versions of the same system ' +
142 'or two different systems of the same name.');
143 }
144 NewSystem = function (sceneEl) { System.call(this, sceneEl); };
145 NewSystem.prototype = Object.create(System.prototype, proto);
146 NewSystem.prototype.name = name;
147 NewSystem.prototype.constructor = NewSystem;
148 NewSystem.prototype.schema = processSchema(NewSystem.prototype.schema);
149 systems[name] = NewSystem;
150
151 // Initialize systems for existing scenes
152 if (ready.canInitializeElements) {
153 for (i = 0; i < scenes.length; i++) { scenes[i].initSystem(name); }
154 }
155}

Callers 11

material.jsFile · 0.90
webxr.jsFile · 0.90
geometry.jsFile · 0.90
camera.jsFile · 0.90
obb-collider.jsFile · 0.90
gltf-model.jsFile · 0.90
light.jsFile · 0.90
shadow.jsFile · 0.90
renderer.jsFile · 0.90
system.test.jsFile · 0.90

Calls 1

initSystemMethod · 0.80

Tested by

no test coverage detected