|  |  |  | 
|---|
|  |  |  | }, [curSprite]); | 
|---|
|  |  |  | const prevCurSprite = prevCurSpriteRef.current; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | const swichFloor = async (floor) => { | 
|---|
|  |  |  | await Utils.fetchMapData(floor); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | player.hideGridlines(); | 
|---|
|  |  |  | player.hideStarryBackground(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | player.activateMapEvent(null); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Utils.removeSelectedEffect(); | 
|---|
|  |  |  | setCurSPrite(null); | 
|---|
|  |  |  | setDeviceVisible(false); | 
|---|
|  |  |  | setSettingsVisible(false); | 
|---|
|  |  |  | setDrawerVisible(false); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | mapContainer.children.forEach(child => { | 
|---|
|  |  |  | Utils.viewFeature(child, setCurSPrite); | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // watch curFloor | 
|---|
|  |  |  | React.useEffect(() => { | 
|---|
|  |  |  | Utils.fetchMapData(curFloor); | 
|---|
|  |  |  | if (!mapContainer && !dataFetched) { | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | swichFloor(curFloor); | 
|---|
|  |  |  | }, [curFloor]); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // didClickSprite, stop triggers both sprite click and play's selection boxs | 
|---|