默认墙材质

This commit is contained in:
zh
2025-07-09 17:40:13 +08:00
parent ff4f823a27
commit 574538e7bb
4 changed files with 15 additions and 15 deletions

View File

@ -32,10 +32,10 @@ class WallStereoscopic extends Base {
* */
constructor(sdk, options, _Dialog = {}) {
super(sdk, options);
this.options.color = options.color || "#00d9ff"
this.options.color = options.color || "#ff0000"
this.options.extrudedHeight = options.extrudedHeight || 2.4
this.options.positions = options.positions
this.options.material = Number(options.material) || 0
this.options.material = (Number(options.material) || Number(options.material) === 0) ? Number(options.material) : 3
this.options.duration = (options.duration || options.duration === 0) ? options.duration : 1000
this.options.show = (options.show || options.show === false) ? options.show : true
this.options['nose-to-tail'] = options['nose-to-tail'] || false
@ -113,7 +113,7 @@ class WallStereoscopic extends Base {
return this.options.color
}
set color(v) {
this.options.color = v
this.options.color = v || '#ff0000'
this.entity.polylineVolume.material = this.getMaterial()
if (this._elms.color) {
this._elms.color.forEach((item, i) => {
@ -121,7 +121,7 @@ class WallStereoscopic extends Base {
el: item.el,
size: 'mini',//颜色box类型
alpha: true,//是否开启透明度
defaultColor: v,
defaultColor: this.options.color,
disabled: false,//是否禁止打开颜色选择器
openPickerAni: 'opacity',//打开颜色选择器动画
sure: (c) => {
@ -140,10 +140,10 @@ class WallStereoscopic extends Base {
return this.options.material
}
set material(v) {
this.options.material = Number(v)
this.options.material = (Number(v) || Number(v) === 0) ? Number(v) : 3
this.entity.polylineVolume.material = this.getMaterial()
this._elms.material && this._elms.material.forEach((item) => {
item.value = v
item.value = this.options.material
})
}