()
| 166 | |
| 167 | @action |
| 168 | purge() { |
| 169 | // 追踪物料使用:批量减少所有节点的使用计数 |
| 170 | for (const node of this.nodes) { |
| 171 | if (node.componentName) { |
| 172 | this.designer.materials.decrementUsage(node.materialUsageKey) |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | this.rootNode?.purge() |
| 177 | this.nodes.clear() |
| 178 | this._nodesMap.clear() |
| 179 | this.rootNode = null |
| 180 | } |
| 181 | |
| 182 | @action |
| 183 | createNode(schema: NodeSchema, checkId = true) { |
no test coverage detected