(sys)
| 23 | * @return {array} An array of physics plugin keys to start for this Scene, or `undefined` if none are configured. |
| 24 | */ |
| 25 | var 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 | |
| 61 | module.exports = GetPhysicsPlugins; |
no test coverage detected
searching dependent graphs…