@series-inc/rundot-3d-engine 0.6.11 → 0.6.14
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.
- package/dist/{chunk-WLXQBO3A.js → chunk-Z6I4EBCF.js} +58 -2
- package/dist/chunk-Z6I4EBCF.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/systems/index.d.ts +28 -1
- package/dist/systems/index.js +1 -1
- package/package.json +1 -1
- package/scripts/postinstall.mjs +64 -0
- package/dist/chunk-WLXQBO3A.js.map +0 -1
|
@@ -1751,11 +1751,13 @@ function PlayAudioOneShot2D(audioBank, audioClip) {
|
|
|
1751
1751
|
const gain = ctx.createGain();
|
|
1752
1752
|
gain.gain.value = audio.getVolume();
|
|
1753
1753
|
source.connect(gain);
|
|
1754
|
+
const listenerGain = AudioSystem.mainListener?.gain;
|
|
1755
|
+
const destination = listenerGain ?? ctx.destination;
|
|
1754
1756
|
const filters = audio.filters;
|
|
1755
1757
|
if (filters && filters.length > 0) {
|
|
1756
1758
|
gain.connect(filters[0]);
|
|
1757
1759
|
} else {
|
|
1758
|
-
gain.connect(
|
|
1760
|
+
gain.connect(destination);
|
|
1759
1761
|
}
|
|
1760
1762
|
source.start(0);
|
|
1761
1763
|
}
|
|
@@ -5893,6 +5895,60 @@ var StowKitSystem = class _StowKitSystem {
|
|
|
5893
5895
|
);
|
|
5894
5896
|
return results;
|
|
5895
5897
|
}
|
|
5898
|
+
/**
|
|
5899
|
+
* Preload multiple asset types concurrently.
|
|
5900
|
+
* All categories load in parallel via Promise.all, eliminating sequential blocking.
|
|
5901
|
+
*/
|
|
5902
|
+
async preloadAll(options) {
|
|
5903
|
+
const start = performance.now();
|
|
5904
|
+
const [meshes, skinnedMeshes, textures, audio, animations] = await Promise.all([
|
|
5905
|
+
options.meshes ? this.preloadMeshes(options.meshes) : Promise.resolve(/* @__PURE__ */ new Map()),
|
|
5906
|
+
options.skinnedMeshes ? this.preloadSkinnedMeshes(options.skinnedMeshes.names, options.skinnedMeshes.scale) : Promise.resolve(/* @__PURE__ */ new Map()),
|
|
5907
|
+
options.textures ? this.preloadTexturesInternal(options.textures) : Promise.resolve(/* @__PURE__ */ new Map()),
|
|
5908
|
+
options.audio ? this.preloadAudio(options.audio) : Promise.resolve(/* @__PURE__ */ new Map()),
|
|
5909
|
+
options.animations ? this.preloadAnimationsInternal(options.animations) : Promise.resolve(/* @__PURE__ */ new Map())
|
|
5910
|
+
]);
|
|
5911
|
+
console.log(
|
|
5912
|
+
`[StowKitSystem] preloadAll completed in ${(performance.now() - start).toFixed(0)}ms`
|
|
5913
|
+
);
|
|
5914
|
+
return { meshes, skinnedMeshes, textures, audio, animations };
|
|
5915
|
+
}
|
|
5916
|
+
async preloadTexturesInternal(textureNames) {
|
|
5917
|
+
const start = performance.now();
|
|
5918
|
+
const results = /* @__PURE__ */ new Map();
|
|
5919
|
+
await Promise.allSettled(
|
|
5920
|
+
textureNames.map(async (name) => {
|
|
5921
|
+
try {
|
|
5922
|
+
const texture = await this.getTexture(name);
|
|
5923
|
+
results.set(name, texture);
|
|
5924
|
+
} catch (e) {
|
|
5925
|
+
console.warn(`[StowKitSystem] Failed to preload texture "${name}":`, e);
|
|
5926
|
+
}
|
|
5927
|
+
})
|
|
5928
|
+
);
|
|
5929
|
+
console.log(
|
|
5930
|
+
`[StowKitSystem] Preloaded ${results.size}/${textureNames.length} textures in ${(performance.now() - start).toFixed(0)}ms`
|
|
5931
|
+
);
|
|
5932
|
+
return results;
|
|
5933
|
+
}
|
|
5934
|
+
async preloadAnimationsInternal(anims) {
|
|
5935
|
+
const start = performance.now();
|
|
5936
|
+
const results = /* @__PURE__ */ new Map();
|
|
5937
|
+
await Promise.allSettled(
|
|
5938
|
+
anims.map(async ({ name, meshName }) => {
|
|
5939
|
+
try {
|
|
5940
|
+
const clip = await this.getAnimation(name, meshName);
|
|
5941
|
+
results.set(name, clip);
|
|
5942
|
+
} catch (e) {
|
|
5943
|
+
console.warn(`[StowKitSystem] Failed to preload animation "${name}":`, e);
|
|
5944
|
+
}
|
|
5945
|
+
})
|
|
5946
|
+
);
|
|
5947
|
+
console.log(
|
|
5948
|
+
`[StowKitSystem] Preloaded ${results.size}/${anims.length} animations in ${(performance.now() - start).toFixed(0)}ms`
|
|
5949
|
+
);
|
|
5950
|
+
return results;
|
|
5951
|
+
}
|
|
5896
5952
|
// ============================================
|
|
5897
5953
|
// Pack Access
|
|
5898
5954
|
// ============================================
|
|
@@ -6412,4 +6468,4 @@ export {
|
|
|
6412
6468
|
PrefabLoader,
|
|
6413
6469
|
StowKitSystem
|
|
6414
6470
|
};
|
|
6415
|
-
//# sourceMappingURL=chunk-
|
|
6471
|
+
//# sourceMappingURL=chunk-Z6I4EBCF.js.map
|