Skip to content

Commit

Permalink
use light type instead of constructor name
Browse files Browse the repository at this point in the history
  • Loading branch information
jianhuang01 committed Apr 3, 2019
1 parent 1f5d1e1 commit 1112fc9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/core/src/effects/lighting-effect.js
Expand Up @@ -28,16 +28,16 @@ export default class LightingEffect extends Effect {
for (const key in props) {
const lightSource = props[key];

switch (lightSource.constructor.name) {
case 'AmbientLight':
switch (lightSource.type) {
case 'ambient':
this.ambientLight = lightSource;
break;

case 'DirectionalLight':
case 'directional':
this.directionalLights.push(lightSource);
break;

case 'PointLight':
case 'point':
this.pointLights.push(lightSource);
break;
default:
Expand Down

0 comments on commit 1112fc9

Please sign in to comment.