@adatechnology/game-test-room 0.23.0 → 0.24.0
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/index.d.ts +5 -0
- package/dist/index.global.js +217 -140
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/room.ts
|
|
2
2
|
import { createDestruction, JOINT_DEFAULTS, resolveStrings as resolveDestructionStrings } from "@adatechnology/game-destruction";
|
|
3
|
-
import { createAudioEngine, createAudioSink, loadKitSamples } from "@adatechnology/game-audio";
|
|
3
|
+
import { createAudioEngine, createAudioSink, loadKitSamples, loadUserSamples } from "@adatechnology/game-audio";
|
|
4
4
|
import { createDestructionRenderer, createDestructionSound, dragSoundKey, impactKey, impactSoundKeys, specFromObject3D } from "@adatechnology/game-destruction-three";
|
|
5
5
|
import { bodyMass, KNOCK_CHEST, knockOf, surfaceOfMaterial } from "@adatechnology/game-contracts";
|
|
6
6
|
|
|
@@ -5378,7 +5378,11 @@ function createTestRoom(options) {
|
|
|
5378
5378
|
const audio = options.audio === false ? null : options.audio ?? createAudioEngine({ deferredStart: {} });
|
|
5379
5379
|
const destructionSound = audio ? createDestructionSound(audio) : null;
|
|
5380
5380
|
if (audio && options.samplesBaseUrl !== null) {
|
|
5381
|
-
void loadKitSamples(audio, { baseUrl: options.samplesBaseUrl ?? "./sfx/" }).then((bank) => {
|
|
5381
|
+
void loadKitSamples(audio, { baseUrl: options.samplesBaseUrl ?? "./sfx/" }).then(async (bank) => {
|
|
5382
|
+
if (options.userSamplesBaseUrl !== null) {
|
|
5383
|
+
const own = await loadUserSamples(audio, { baseUrl: options.userSamplesBaseUrl ?? "./sfx-local/" });
|
|
5384
|
+
if (own) log.add({ channel: "event", type: "user_sounds", text: `sons do dono: ${own.playing.length} tocando, ${own.behindKit.length} atr\xE1s do SDK`, data: { playing: own.playing, behindKit: own.behindKit } });
|
|
5385
|
+
}
|
|
5382
5386
|
if (!bank || typeof window === "undefined") return;
|
|
5383
5387
|
const preload = () => {
|
|
5384
5388
|
window.removeEventListener("keydown", preload, true);
|