* Sets the effects. * * @param {Effect[]} effects - The effects. * @protected
(effects)
| 389 | */ |
| 390 | |
| 391 | setEffects(effects) { |
| 392 | |
| 393 | for(const effect of this.effects) { |
| 394 | |
| 395 | effect.removeEventListener("change", this.listener); |
| 396 | |
| 397 | } |
| 398 | |
| 399 | this.effects = effects.sort((a, b) => (b.attributes - a.attributes)); |
| 400 | |
| 401 | for(const effect of this.effects) { |
| 402 | |
| 403 | effect.addEventListener("change", this.listener); |
| 404 | |
| 405 | } |
| 406 | |
| 407 | } |
| 408 | |
| 409 | /** |
| 410 | * Updates the compound shader material. |