| | |
| | | }; |
| | | } |
| | | |
| | | export const querySprite = (type, no) => { |
| | | if (!mapContainer) { |
| | | return; |
| | | } |
| | | for (const sprite of mapContainer.children) { |
| | | if (sprite.data?.type === type && sprite.data?.no === no) { |
| | | return sprite; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // show sprite feature from sprite click event |
| | | export const viewFeature = (sprite, setCurSPrite) => { |
| | | sprite.off('pointerup'); |
| | |
| | | const mapVo = JSON.parse(data); |
| | | // shuttle |
| | | for (const shuttleVo of mapVo.shuttleVos) { |
| | | console.log(shuttleVo); |
| | | const shuttle = querySprite(SENSOR_TYPE.SHUTTLE, shuttleVo.shuttleNo); |
| | | if (!shuttle && !shuttleVo.curLocNo) { continue; } |
| | | const { row, bay, lev } = parseLocNo(shuttleVo.curLocNo); |
| | | const shelf = querySprite(SENSOR_TYPE.SHELF, row + '-' + bay); |
| | | new TWEEDLE.Tween(shuttle.position).easing(TWEEDLE.Easing.Linear.None).to({ |
| | | x: shelf.position.x, |
| | | y: shelf.position.y |
| | | }, 1000).start(); |
| | | } |
| | | } |