sa2kit 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -571,7 +571,24 @@ var MMDPlayerEnhanced = ({
571
571
  });
572
572
  console.log("\u2705 [MMDPlayerEnhanced] Ammo.js \u52A0\u8F7D\u5B8C\u6210");
573
573
  }
574
- const loader = new MMDLoader();
574
+ const manager = new THREE2.LoadingManager();
575
+ const modelUrl = currentResources.modelPath;
576
+ const basePath = modelUrl.substring(0, modelUrl.lastIndexOf("/") + 1);
577
+ console.log("\u{1F4C2} [MMDPlayerEnhanced] \u6A21\u578B\u57FA\u7840\u8DEF\u5F84:", basePath);
578
+ manager.setURLModifier((url) => {
579
+ if (url.startsWith("http://") || url.startsWith("https://")) {
580
+ console.log("\u{1F517} [MMDPlayerEnhanced] \u4F7F\u7528\u5B8C\u6574 URL:", url);
581
+ return url;
582
+ }
583
+ if (url.startsWith("/")) {
584
+ console.log("\u{1F517} [MMDPlayerEnhanced] \u4F7F\u7528\u7EDD\u5BF9\u8DEF\u5F84:", url);
585
+ return url;
586
+ }
587
+ const fullUrl = basePath + url;
588
+ console.log("\u{1F517} [MMDPlayerEnhanced] \u76F8\u5BF9\u8DEF\u5F84\u8F6C\u6362:", url, "->", fullUrl);
589
+ return fullUrl;
590
+ });
591
+ const loader = new MMDLoader(manager);
575
592
  const helper = new MMDAnimationHelper();
576
593
  helperRef.current = helper;
577
594
  setLoadingProgress(20);