Suggest changing the Layers on the scene to optional

If Layer is not used, it will be undefined in scene.layers.

I looked at the source code:

So this part is changed to:

declare module "../abstractScene" {
    export interface AbstractScene {
        /**
         * The list of layers (background and foreground) of the scene
         */
        layers?: Array<Layer>;
    }
}

It would mean quite a number of changes, because we would now have to check for undefined anywhere we access scene.layers. Did you encounter a case where the layer scene component has been created with an empty scene?

Okay, I found out the reason. I see that this version has been optimized now.

The version I am using is 7.14.0, So it leads to a difference

1 Like