| | |
| | | |
| | | mapContainer.addChild(agvPath); |
| | | } |
| | | |
| | | export const removeAgvGraphics = () => { |
| | | if (!mapContainer) { |
| | | return; |
| | | } |
| | | for (let i = mapContainer.children.length - 1; i >= 0; i--) { |
| | | const child = mapContainer.children[i]; |
| | | if (child?.data?.type === DEVICE_TYPE.AGV) { |
| | | if (child.data.jobEffect) { |
| | | app?.ticker.remove(child.data.jobEffect._onTick); |
| | | child.removeChild(child.data.jobEffect); |
| | | child.data.jobEffect.destroy(true); |
| | | child.data.jobEffect = null; |
| | | } |
| | | mapContainer.removeChild(child); |
| | | child.destroy({ children: true, texture: false, baseTexture: false }); |
| | | } else if (child?.name?.startsWith('agvPath-')) { |
| | | mapContainer.removeChild(child); |
| | | child.destroy({ children: true, texture: false, baseTexture: false }); |
| | | } |
| | | } |
| | | } |