Преглед на файлове

this._newUniforms is null bug fixed

NasimiAsl преди 6 години
родител
ревизия
15de65358f
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      materialsLibrary/src/custom/customMaterial.ts

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

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