mirror of
https://github.com/liabru/matter-js.git
synced 2025-01-12 16:08:50 -05:00
change example matter-wrap require precedence
This commit is contained in:
parent
7bfd3c2b78
commit
aa1e4e7738
2 changed files with 10 additions and 10 deletions
|
@ -1,12 +1,12 @@
|
|||
var Example = Example || {};
|
||||
|
||||
Example.avalanche = function() {
|
||||
if (typeof require !== 'undefined') {
|
||||
// either require the plugin directly (Node.js, Webpack etc.)
|
||||
Matter.use(require('matter-wrap'));
|
||||
} else {
|
||||
// or by name from plugin registry (Browser global)
|
||||
if (typeof MatterWrap !== 'undefined') {
|
||||
// either use by name from plugin registry (Browser global)
|
||||
Matter.use('matter-wrap');
|
||||
} else {
|
||||
// or require and use the plugin directly (Node.js, Webpack etc.)
|
||||
Matter.use(require('matter-wrap'));
|
||||
}
|
||||
|
||||
var Engine = Matter.Engine,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
var Example = Example || {};
|
||||
|
||||
Example.ballPool = function() {
|
||||
if (typeof require !== 'undefined') {
|
||||
// either require the plugin directly (Node.js, Webpack etc.)
|
||||
Matter.use(require('matter-wrap'));
|
||||
} else {
|
||||
// or by name from plugin registry (Browser global)
|
||||
if (typeof MatterWrap !== 'undefined') {
|
||||
// either use by name from plugin registry (Browser global)
|
||||
Matter.use('matter-wrap');
|
||||
} else {
|
||||
// or require and use the plugin directly (Node.js, Webpack etc.)
|
||||
Matter.use(require('matter-wrap'));
|
||||
}
|
||||
|
||||
var Engine = Matter.Engine,
|
||||
|
|
Loading…
Reference in a new issue