浏览代码

Simplifying if else statement as ternary in webgl_machingcubes

Tristan Valcke 8 年之前
父节点
当前提交
fd58b358c0
共有 1 个文件被更改,包括 2 次插入19 次删除
  1. 2 19
      examples/webgl_marchingcubes.html

+ 2 - 19
examples/webgl_marchingcubes.html

@@ -421,25 +421,8 @@
 					m_s.setValue( mat.s );
 					m_l.setValue( mat.l );
 
-					if ( current_material === "textured" ) {
-
-						effect.enableUvs = true;
-
-					} else {
-
-						effect.enableUvs = false;
-
-					}
-
-					if ( current_material === "colors" ) {
-
-						effect.enableColors = true;
-
-					} else {
-
-						effect.enableColors = false;
-
-					}
+					effect.enableUvs = (current_material === "textured") ? true : false;
+					effect.enableColors = (current_material === "colors") ? true : false;
 
 				};