@@ -18,6 +18,10 @@ const GetObjectDescription = (obj, precision = 1) => {
18
18
count = obj . children . list . length ;
19
19
} else if ( type === "ParticleEmitter" ) {
20
20
count = obj . getParticleCount ( ) ;
21
+ } else if ( type === "SpriteGPULayer" ) {
22
+ count = obj . memberCount ;
23
+ } else if ( type === "TilemapLayer" || type === "TilemapGPULayer" ) {
24
+ count = obj . tilesTotal ;
21
25
} else if ( obj . list ) {
22
26
count = obj . list . length ;
23
27
}
@@ -66,6 +70,7 @@ const WalkDisplayListObj = (obj, output = [], currentDepth = 0, maxDepth = 10, m
66
70
const { POSITIVE_INFINITY } = Number ;
67
71
const TextureEvents = Phaser . Textures . Events ;
68
72
const CacheEvents = Phaser . Cache . Events ;
73
+ const CoreEvents = Phaser . Core . Events ;
69
74
const KeyboardEvents = Phaser . Input . Keyboard . Events ;
70
75
const SceneEvents = Phaser . Scenes . Events ;
71
76
const { KeyCodes } = Phaser . Input . Keyboard ;
@@ -124,6 +129,7 @@ class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
124
129
this . start ( ) ;
125
130
}
126
131
start ( ) {
132
+ const { game } = this ;
127
133
const { cache, events, input, make, renderer } = this . systems ;
128
134
const fontCache = cache . bitmapFont ;
129
135
const keyboard = input == null ? void 0 : input . keyboard ;
@@ -132,7 +138,7 @@ class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
132
138
fontCache . events . on ( CacheEvents . ADD , this . onFontCacheAdded , this ) ;
133
139
return ;
134
140
}
135
- events . on ( SceneEvents . RENDER , this . render , this ) ;
141
+ game . events . on ( CoreEvents . POST_RENDER , this . render , this ) ;
136
142
this . camera = new Phaser . Cameras . Scene2D . Camera ( 0 , 0 , width , height ) . setBounds ( 0 , 0 , POSITIVE_INFINITY , POSITIVE_INFINITY ) . setRoundPixels ( true ) ;
137
143
if ( keyboard ) {
138
144
events . on ( SceneEvents . UPDATE , this . update , this ) ;
@@ -142,11 +148,12 @@ class DisplayListWatcher extends Phaser.Plugins.ScenePlugin {
142
148
this . renderText = renderer . type === Phaser . WEBGL ? this . text . renderWebGL : this . text . renderCanvas ;
143
149
}
144
150
stop ( ) {
151
+ const { game } = this ;
145
152
const { cache, events, input, settings } = this . systems ;
146
153
const keyboard = input == null ? void 0 : input . keyboard ;
147
154
cache . bitmapFont . events . off ( CacheEvents . ADD , this . onFontCacheAdded , this ) ;
148
155
events . off ( SceneEvents . UPDATE , this . update , this ) ;
149
- events . off ( SceneEvents . RENDER , this . render , this ) ;
156
+ game . events . off ( CoreEvents . POST_RENDER , this . render , this ) ;
150
157
if ( keyboard ) {
151
158
keyboard . off ( KeyboardEvents . ANY_KEY_DOWN , this . onAnyKeyDown , this ) ;
152
159
}
0 commit comments