| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 | class BabylonFileLoader {  constructor(e) {    for (let a = 0; a < itemInfo.length; a++)      if (itemInfo[a] && 0 !== Object.keys(itemInfo[a]).length) {        const t = e.addMeshTask(          "loadItemsTask" + a,          "",          g_AssetPath + "items/",          itemInfo[a].name + ".babylon"        );        t.onSuccess = e => {          this.onSuccessCallback(e.loadedMeshes[0], itemInfo[a]);        };      }    for (let a = 0; a < manualItemInfo.length; a++)      if (manualItemInfo[a] && 0 !== Object.keys(manualItemInfo[a]).length) {        const n = e.addMeshTask(          "manualItemTask" + a,          "",          g_AssetPath + "items/",          manualItemInfo[a].name + ".babylon"        );        n.onSuccess = e => {          this.onSuccessCallback(e.loadedMeshes[0], manualItemInfo[a]);        };      }    for (let a = 0; a < otherItemInfo.length; a++)      if (otherItemInfo[a] && 0 !== Object.keys(otherItemInfo[a]).length) {        const s = e.addMeshTask(          "otherItemTask" + a,          "",          g_AssetPath + "items/",          otherItemInfo[a].name + ".babylon"        );        s.onSuccess = e => {          this.onSuccessCallback(e.loadedMeshes[0], otherItemInfo[a]);        };      }    e.load();  }  onSuccessCallback(e, a, t = !1) {    const n = e;    (n.name = a.name),      (n.type = a.type),      (n.width = a.width),      (n.length = a.length),      (n.multiply = a.multiply),      (n.direction = a.direction),      (n.scaling = BABYLON.Vector3.One()),      (n.position = BABYLON.Vector3.Zero()),      (n.rotation = BABYLON.Vector3.Zero()),      (n.rotationQuaternion = null),      (n.receiveShadows = !1),      (n.isPickable = !1),      n.setEnabled(!1);    var s = n.getChildren();    for (let a = 0; a < matManager.materials.length; a++) {      const l = 0 < s.length ? s[0] : n;      if (l.material)        if (void 0 === l.material.subMaterials)          matManager.materials[a].name === l.material.name &&            (l.material.dispose(), (l.material = matManager.materials[a]));        else          for (let e = 0; e < l.material.subMaterials.length; e++)            matManager.materials[a].name === l.material.subMaterials[e].name &&              (l.material.subMaterials[e].dispose(),              (l.material.subMaterials[e] = matManager.materials[a]));    }    return (      (a.originMesh = n).freezeWorldMatrix(),      (n.cullingStrategy = g_CullingValue),      t && n.setEnabled(!0),      itemLoaded++,      n    );  }}
 |