Files
youle_cocos/cocoscreator_projects/YouleNexus/extensions/youle-version-manifest/hooks.js
T
joywayer 35216f75e7 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.
2026-09-09 03:13:18 +08:00

22 lines
767 B
JavaScript

'use strict';
const {createSnapshot, publishSnapshot} = require('./core');
let snapshot;
exports.throwError = true;
exports.onBeforeBuild = async function(options) {
snapshot = undefined;
const scenePath = await Editor.Message.request('asset-db', 'query-path', options.startScene);
snapshot = createSnapshot({projectPath: Editor.Project.path, scenePath, startScene: options.startScene});
};
exports.onAfterBuild = async function(options, result) {
try {
const destination = publishSnapshot(snapshot, options, result);
console.log(`[youle-version-manifest] ${snapshot.gameKey}: ${destination}`);
} finally {
snapshot = undefined;
}
};
exports.onError = function() {snapshot = undefined;};
exports.unload = function() {snapshot = undefined;};