MCPcopy
hub / github.com/phaserjs/phaser / GetPhysicsPlugins

Function GetPhysicsPlugins

src/scene/GetPhysicsPlugins.js:25–59  ·  view source on GitHub ↗
(sys)

Source from the content-addressed store, hash-verified

23 * @return {array} An array of physics plugin keys to start for this Scene, or `undefined` if none are configured.
24 */
25var GetPhysicsPlugins = function (sys)
26{
27 var defaultSystem = sys.game.config.defaultPhysicsSystem;
28 var sceneSystems = GetFastValue(sys.settings, 'physics', false);
29
30 if (!defaultSystem && !sceneSystems)
31 {
32 // No default physics system or systems in this scene
33 return;
34 }
35
36 // Let's build the systems array
37 var output = [];
38
39 if (defaultSystem)
40 {
41 output.push(UppercaseFirst(defaultSystem + 'Physics'));
42 }
43
44 if (sceneSystems)
45 {
46 for (var key in sceneSystems)
47 {
48 key = UppercaseFirst(key.concat('Physics'));
49
50 if (output.indexOf(key) === -1)
51 {
52 output.push(key);
53 }
54 }
55 }
56
57 // An array of Physics systems to start for this Scene
58 return output;
59};
60
61module.exports = GetPhysicsPlugins;

Callers 2

Systems.jsFile · 0.85

Calls 2

GetFastValueFunction · 0.85
UppercaseFirstFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…