game objects module

This commit is contained in:
2024-11-05 19:42:33 +02:00
parent 2978f11869
commit e3a2a0251d
4 changed files with 93 additions and 26 deletions
+3
View File
@@ -1,5 +1,7 @@
import decompress from "decompress";
import sharp from 'sharp';
sharp.cache({ files : 0 });
import fs from 'fs';
import path from 'path';
@@ -111,6 +113,7 @@ class GameObjectsManager{
let result = await decompress(src, def);
object.asset.list = result.map(f=>f.path);
object.asset.type = 'bundle';
object.asset.name = `${object.id}/` + result.find(f=>f.path.endsWith('.gltf'))?.path;
}else{
object.asset.type = 'single';
await fs.promises.copyFile(src, def + ext);