Skip to content

Commit 80c0f59

Browse files
committed
GameObjectCreator.remove is a new static function that will remove a custom Game Object creator type.
1 parent 4887696 commit 80c0f59

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/gameobjects/GameObjectCreator.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ GameObjectCreator.register = function (factoryType, factoryFunction)
149149
}
150150
};
151151

152+
GameObjectCreator.remove = function (factoryType)
153+
{
154+
if (GameObjectCreator.prototype.hasOwnProperty(factoryType))
155+
{
156+
delete GameObjectCreator.prototype[factoryType];
157+
}
158+
};
159+
152160
PluginCache.register('GameObjectCreator', GameObjectCreator, 'make');
153161

154162
module.exports = GameObjectCreator;

0 commit comments

Comments
 (0)