Add children after configuration

Ensures the create handler is called
This commit is contained in:
samme 2020-05-11 10:20:52 -07:00
parent d6e8600766
commit 70b8bfe4b0

View file

@ -91,7 +91,7 @@ var Group = new Class({
* @type {Phaser.Structs.Set.<Phaser.GameObjects.GameObject>}
* @since 3.0.0
*/
this.children = new Set(children);
this.children = new Set();
/**
* A flag identifying this object as a group.
@ -236,6 +236,11 @@ var Group = new Class({
*/
this.internalRemoveCallback = GetFastValue(config, 'internalRemoveCallback', null);
if (children)
{
this.addMultiple(children);
}
if (config)
{
this.createMultiple(config);