瀏覽代碼

Fix uniform decorator setter.

master
Palash Bansal 2 年之前
父節點
當前提交
edcdd80b11
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 3 行新增2 行删除
  1. 3
    2
      src/three/utils/decorators.ts

+ 3
- 2
src/three/utils/decorators.ts 查看文件

@@ -29,9 +29,10 @@ export function uniform({uniforms, propKey, thisTarget = false, onChange}: {unif
return getUniform(this).value
},
set(newVal: any) {
let val = getUniform(this).value
const u = getUniform(this)
const val = u.value
if (val === newVal) return
val = newVal
u.value = newVal
safeSetProperty(this, 'uniformsNeedUpdate', true, true)
onChange && callOnChange.call(this, onChange, [propertyKey, newVal])
},

Loading…
取消
儲存