react-simple-game-engine
Version:
[WIP] not able to use in currently. <!-- Document cumming soon... -->
21 lines (20 loc) • 662 B
JavaScript
import { SoundType } from "../export-enums";
export function SoundFrom(source, type) {
if (type === void 0) { type = SoundType.ONCE; }
return function (target, propertyKey) {
var _a = source
? typeof source === "string"
? { src: source, volume: undefined }
: source
: { volume: undefined, src: undefined }, volume = _a.volume, src = _a.src;
if (!target.soundsDecor) {
target.soundsDecor = [];
}
target.soundsDecor.push({
volume: volume,
propertyKey: propertyKey,
src: src,
type: type,
});
};
}