| | |
| | | |
| | | let _flowAnimationContainer;//水流动画容器 |
| | | let _flowImgSrc = "https://static.bimface.com/attach/34d0d3aeb2e348aea5f3203b760ca667_flow5.png";//水流材质图片 |
| | | let _flowImgLocal = "../img/flowEffect.png";//本地水流材质图片 |
| | | let _flowImgLocal = "../img/flowEffect.png";//本地水流材质图片,测试没有通过 |
| | | let _flowEffectList = new Set();//水流动画列表 |
| | | |
| | | |
| | |
| | | |
| | | //加载水流动画 |
| | | function loadFlowEffect(item) { |
| | | unloadFlowMaterial(); |
| | | unloadFlowEffect(); |
| | | let flowMaterial = createFlowMaterial(item); |
| | | let flowEffect = createFlowEffect(flowMaterial, item); |
| | | flowEffect.play(); |
| | |
| | | |
| | | //加载水流动画列表 |
| | | function loadFlowEffectList(data) { |
| | | unloadFlowMaterial(); |
| | | unloadFlowEffect(); |
| | | if (data != null && data.length > 0) { |
| | | data.forEach((x, index) => { |
| | | data.forEach(x => { |
| | | let flowMaterial = createFlowMaterial(x); |
| | | createFlowEffect(flowMaterial, x); |
| | | }); |
| | |
| | | } |
| | | } |
| | | |
| | | //通过id卸载水流材质 |
| | | function unloadFlowMaterialById(id) { |
| | | //通过id卸载水流动画 |
| | | function unloadFlowEffectById(id) { |
| | | if (_flowEffectList.size > 0) { |
| | | let flowEffectId = getFlowEffectId(id); |
| | | let flowEffect = null; |
| | |
| | | } |
| | | }); |
| | | if (flowEffect != null) { |
| | | //flowEffect.stop(); |
| | | _flowEffectList.delete(flowEffect); |
| | | let flowMaterialId = getFlowMaterialId(id); |
| | | initialFlowAnimationContainer(); |
| | |
| | | } |
| | | } |
| | | |
| | | //卸载水流材质 |
| | | function unloadFlowMaterial() { |
| | | //卸载水流动画 |
| | | function unloadFlowEffect() { |
| | | if (_flowEffectList.size > 0) { |
| | | //_flowEffectList.forEach(x => { |
| | | // x.stop(); |
| | | //}); |
| | | _flowEffectList.clear(); |
| | | initialFlowAnimationContainer(); |
| | | let allMaterialList = _flowAnimationContainer.getAllMaterials(); |
| | | if (allMaterialList != null && allMaterialList.length > 0) { |
| | | allMaterialList.foreach(x => { |
| | | allMaterialList.forEach(x => { |
| | | x.clearOverrideComponentsMaterial(); |
| | | }); |
| | | } |