assignTexture(materialParams, mapName, mapDef, colorSpace) {
    const parser = this;
    return this.getDependency('texture', mapDef.index).then(function (texture) {
      if (!texture) return null;
      if (mapDef.texCoord !== undefined && mapDef.texCoord > 0) {
        texture = texture.clone();
        texture.channel = mapDef.texCoord;
      }
      if (parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM]) {
        const transform = mapDef.extensions !== undefined ? mapDef.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM] : undefined;
        if (transform) {
          const gltfReference = parser.associations.get(texture);
          texture = parser.extensions[EXTENSIONS.KHR_TEXTURE_TRANSFORM].extendTexture(texture, transform);
          parser.associations.set(texture, gltfReference);
        }
      }
      if (colorSpace !== undefined) {
        texture.colorSpace = colorSpace;
      }
      materialParams[mapName] = texture;
      return texture;
    });
  }
Asynchronously assigns a texture to the given material parameters.

@param {Object} materialParams
@param {string} mapName
@param {Object} mapDef
@param {string} colorSpace
@return {Promise<Texture>}