소스 검색

Merge pull request #7985 from NasimiAsl/master

this._newUniforms is null bug fixed
David Catuhe 5 년 전
부모
커밋
ac25da97b6
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 2
      materialsLibrary/src/custom/customMaterial.ts
  2. 2 2
      materialsLibrary/src/custom/pbrCustomMaterial.ts

+ 2 - 2
materialsLibrary/src/custom/customMaterial.ts

@@ -92,14 +92,14 @@ export class CustomMaterial extends StandardMaterial {
     }
 
     public ReviewUniform(name: string, arr: string[]): string[] {
-        if (name == "uniform") {
+        if (this._newUniforms && name == "uniform") {
             for (var ind = 0; ind < this._newUniforms.length ; ind ++) {
                 if (this._customUniform[ind].indexOf('sampler') == -1) {
                     arr.push(this._newUniforms[ind]);
                 }
             }
         }
-        if (name == "sampler") {
+        if (this._newUniforms && name == "sampler") {
             for (var ind = 0; ind < this._newUniforms.length ; ind ++) {
                 if (this._customUniform[ind].indexOf('sampler') != -1) {
                     arr.push(this._newUniforms[ind]);

+ 2 - 2
materialsLibrary/src/custom/pbrCustomMaterial.ts

@@ -88,14 +88,14 @@ export class PBRCustomMaterial extends PBRMaterial {
     }
 
     public ReviewUniform(name: string, arr: string[]): string[] {
-        if (name == "uniform") {
+        if (this._newUniforms && name == "uniform") {
             for (var ind = 0; ind < this._newUniforms.length ; ind ++) {
                 if (this._customUniform[ind].indexOf('sampler') == -1) {
                     arr.push(this._newUniforms[ind]);
                 }
             }
         }
-        if (name == "sampler") {
+        if (this._newUniforms && name == "sampler") {
             for (var ind = 0; ind < this._newUniforms.length ; ind ++) {
                 if (this._customUniform[ind].indexOf('sampler') != -1) {
                     arr.push(this._newUniforms[ind]);