|
@@ -95,8 +95,6 @@ export function setModelType(modelType: 'fanLocal' | 'fanLocalDual' | 'fanLocalS
|
|
|
group.children.forEach((e) => {
|
|
group.children.forEach((e) => {
|
|
|
e.visible = true;
|
|
e.visible = true;
|
|
|
});
|
|
});
|
|
|
- debugger;
|
|
|
|
|
-
|
|
|
|
|
// 模型发生了替换,需要使用摄像头动画// 模型不同需要不同的初始角度与位置
|
|
// 模型发生了替换,需要使用摄像头动画// 模型不同需要不同的初始角度与位置
|
|
|
if (type == 'fanLocal') {
|
|
if (type == 'fanLocal') {
|
|
|
const oldCameraPosition = { x: 615, y: 275, z: 744 };
|
|
const oldCameraPosition = { x: 615, y: 275, z: 744 };
|
|
@@ -199,14 +197,21 @@ export const destroy = () => {
|
|
|
// 为了兼容性而添加的方法导出
|
|
// 为了兼容性而添加的方法导出
|
|
|
export function addText(d, e) {
|
|
export function addText(d, e) {
|
|
|
if (!model) return;
|
|
if (!model) return;
|
|
|
- if (modelContextList[0]) modelContextList[0].context?.addText(d);
|
|
|
|
|
- if (modelContextList[1]) modelContextList[1].context?.addText(e);
|
|
|
|
|
- if (modelContextList[2]) modelContextList[2].context?.addText(d);
|
|
|
|
|
|
|
+ modelContextList.forEach(({ type, context }) => {
|
|
|
|
|
+ if (!context || !context.addText) return;
|
|
|
|
|
+ // fanLocalDual 需要数组参数(左右风机数据),其余各模型接受单个对象
|
|
|
|
|
+ if (type === 'fanLocalDual') {
|
|
|
|
|
+ context.addText(e);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ context.addText(d);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
export function addCssText() {
|
|
export function addCssText() {
|
|
|
if (!model) return;
|
|
if (!model) return;
|
|
|
- if (modelContextList[0] && modelContextList[0].context && modelContextList[0].context['addCssText']) modelContextList[0].context['addCssText']();
|
|
|
|
|
- if (modelContextList[2] && modelContextList[2].context && modelContextList[2].context['addCssText']) modelContextList[2].context['addCssText']();
|
|
|
|
|
|
|
+ modelContextList.forEach(({ context }) => {
|
|
|
|
|
+ if (context && context['addCssText']) context['addCssText']();
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
export function playSmoke(d) {
|
|
export function playSmoke(d) {
|
|
|
if (!model) return;
|
|
if (!model) return;
|