feat: integrate room framework and isolated subgame bundles
Complete room UI and protocol integration, move game definitions and resources behind bundle entries, publish authoritative version XML, and document single-game builds. Include all current resource changes and experiment artifacts.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import {director,Director,assetManager,TextAsset,Prefab,instantiate,js} from 'cc';
|
||||
director.once(Director.EVENT_AFTER_SCENE_LAUNCH,async()=>{
|
||||
const report:any={ok:false,requests:[]};(globalThis as any).__probe=report;
|
||||
try{const target=await fetch('./target.json').then(r=>{if(!r.ok)throw Error('target missing');return r.json();});
|
||||
report.selected=target.bundle;
|
||||
const bundle=await new Promise<any>((resolve,reject)=>assetManager.loadBundle(target.bundle,(e,b)=>e?reject(e):resolve(b)));
|
||||
const entry:any=js.getClassByName(target.entry);if(!entry)throw Error('entry missing');report.code=entry.run();
|
||||
const text=await new Promise<TextAsset>((resolve,reject)=>bundle.load('private',TextAsset,(e,a)=>e?reject(e):resolve(a)));report.text=text.text;
|
||||
const prefab=await new Promise<Prefab>((resolve,reject)=>bundle.load('View',Prefab,(e,a)=>e?reject(e):resolve(a)));const node=instantiate(prefab);node.parent=director.getScene();report.prefab=node.name;
|
||||
report.otherRegistered=!!js.getClassByName(target.otherEntry);report.ok=true;
|
||||
}catch(e){report.error=String(e);}
|
||||
console.log('PROBE_RESULT',JSON.stringify(report));
|
||||
});
|
||||
Reference in New Issue
Block a user