From 60908c00556f4f53d82f5588ae3013f80c443590 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期四, 14 十一月 2024 17:22:58 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicFlowEffect.js | 47 +++++++++++++++++++++++++++++++---------------- 1 files changed, 31 insertions(+), 16 deletions(-) diff --git a/WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicFlowEffect.js b/WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicFlowEffect.js index 078cf8e..8a8b286 100644 --- a/WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicFlowEffect.js +++ b/WinFrmUI/Yw.WinFrmUI.Bimface.Core/bimface/js/LogicFlowEffect.js @@ -1,15 +1,13 @@ 锘� 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(); @@ -18,9 +16,9 @@ //鍔犺浇姘存祦鍔ㄧ敾鍒楄〃 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); }); @@ -29,8 +27,29 @@ } } -//閫氳繃id鍗歌浇姘存祦鏉愯川 -function unloadFlowMaterialById(id) { +//鏇存柊姘存祦鍔ㄧ敾 +function updateFlowEffect(item) { + if (_flowEffectList.size > 0) { + let flowEffectId = getFlowEffectId(item.id); + _flowEffectList.forEach(x => { + if (x.getId() == flowEffectId) { + x.setSpeed([item.speedx, item.speedy]); + } + }); + } +} + +//鏇存柊姘存祦鍔ㄧ敾鍒楄〃 +function updateFlowEffectList(data) { + if (data != null && data.length > 0) { + data.forEach(x => { + updateFlowEffect(x); + }); + } +} + +//閫氳繃id鍗歌浇姘存祦鍔ㄧ敾 +function unloadFlowEffectById(id) { if (_flowEffectList.size > 0) { let flowEffectId = getFlowEffectId(id); let flowEffect = null; @@ -40,7 +59,6 @@ } }); if (flowEffect != null) { - //flowEffect.stop(); _flowEffectList.delete(flowEffect); let flowMaterialId = getFlowMaterialId(id); initialFlowAnimationContainer(); @@ -53,17 +71,14 @@ } } -//鍗歌浇姘存祦鏉愯川 -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(); }); } @@ -102,7 +117,7 @@ // 鏋勯�犳按娴佸姩鐢婚厤缃� let flowEffectConfig = new Glodon.Bimface.Plugins.Animation.FlowEffectConfig(); flowEffectConfig.material = material; - flowEffectConfig.speed = [item.speed, 0]; + flowEffectConfig.speed = [item.speedx, item.speedy]; flowEffectConfig.viewer = _viewer; flowEffectConfig.id = getFlowEffectId(item.id); //鏋勯�犳按娴佸姩鐢� -- Gitblit v1.9.3