Parcourir la source

Fix uniform decorator setter.

master
Palash Bansal il y a 2 ans
Parent
révision
edcdd80b11
Aucun compte lié à l'adresse e-mail de l'auteur
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3
    2
      src/three/utils/decorators.ts

+ 3
- 2
src/three/utils/decorators.ts Voir le fichier

@@ -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])
},

Chargement…
Annuler
Enregistrer