Currently, secondary development provides getParent and getChildren methods to retrieve the parent and child nodes of an element, allowing us to get the complete structure of the layer list. For more details, refer to the API documentation.:Element class
This interface is mainly used in 3D secondary development, but it can also be applied in 2D. Let’s take a look at how to use this interface.
First, we create a sample 3D scene in the Wings Engine:
Attach the secondary development code to the model element:
1 | export class SampleExtension { |
After reloading the code, we can see that the child elements and parent elements of the current element are printed.