xujialiang 4 年之前
父节点
当前提交
2cde1f7945
共有 5 个文件被更改,包括 176 次插入7 次删除
  1. 7 7
      assets/d3d/gunFire/zhuodan.fbx.meta
  2. 5 0
      tools/createQQ.bat
  3. 5 0
      tools/qqMove.bat
  4. 159 0
      tools/qqbuild/main.js
  5. 0 0
      tools/qqbuild/src/system.bundle.js

+ 7 - 7
assets/d3d/gunFire/zhuodan.fbx.meta

@@ -80,12 +80,12 @@
         "events": []
       }
     },
-    "adacb": {
+    "a55e7": {
       "importer": "gltf-embeded-image",
-      "uuid": "7c735b05-1052-417a-bab4-49dbefdbb9fc@adacb",
+      "uuid": "7c735b05-1052-417a-bab4-49dbefdbb9fc@a55e7",
       "displayName": "",
-      "id": "adacb",
-      "name": "file2.image",
+      "id": "a55e7",
+      "name": "5555.png.image",
       "ver": "1.0.2",
       "imported": true,
       "files": [
@@ -118,7 +118,7 @@
         "premultiplyAlpha": false,
         "anisotropy": 1,
         "isUuid": true,
-        "imageUuidOrDatabaseUri": "7c735b05-1052-417a-bab4-49dbefdbb9fc@adacb"
+        "imageUuidOrDatabaseUri": "7c735b05-1052-417a-bab4-49dbefdbb9fc@a55e7"
       }
     },
     "826f3": {
@@ -141,8 +141,8 @@
   "userData": {
     "imageMetas": [
       {
-        "name": "file2",
-        "uri": "7c735b05-1052-417a-bab4-49dbefdbb9fc@adacb"
+        "name": "5555.png",
+        "uri": "7c735b05-1052-417a-bab4-49dbefdbb9fc@a55e7"
       }
     ],
     "animationImportSettings": [

+ 5 - 0
tools/createQQ.bat

@@ -0,0 +1,5 @@
+@echo off
+echo "使用bat脚本来复制文件夹和文件"
+echo.
+xcopy ..\build\wechatgame\*.* ..\build\qq\ /s /e /c /y /h /r
+pause

+ 5 - 0
tools/qqMove.bat

@@ -0,0 +1,5 @@
+@echo off
+echo "使用bat脚本来复制文件夹和文件"
+echo.
+xcopy qqbuild\*.* ..\build\qq\ /s /e /c /y /h /r
+pause

+ 159 - 0
tools/qqbuild/main.js

@@ -0,0 +1,159 @@
+var settings = window._CCSettings;
+
+function boot () {
+    var onStart = function () {
+        window._CCSettings = undefined;
+
+        cc.loader.downloader._subpackages = settings.subpackages;
+        cc.view.enableRetina(true);
+        cc.view.resizeWithBrowserSize(true);
+
+        //在launchScene面前添加底下这句话。这样子游戏运行的时候就可以判断为QQ小游戏啦。
+        cc.sys.platform = cc.sys.QQ_PLAY;
+		
+        var launchScene = settings.launchScene;
+        // load scene
+        cc.director.loadScene(launchScene, null,
+            function () {
+                cc.view.setDesignResolutionSize(750, 1334, 4);
+                cc.loader.onProgress = null;
+                console.log('Success to load scene: ' + launchScene);
+            }
+        );
+    };
+
+    loadJsListModules(settings.jsList).then(function () {
+        (boot.systemGlobal || System)['import']('virtual:///prerequisite-imports:main').then(function () {
+            cc.game.run(onStart);
+        }).catch(function (error) {
+            console.error("Load project module error: \n" + error);
+        });
+    });
+};
+window.boot = boot;
+
+// Generate options to init cc.game
+function initOptions () {
+
+    var uuids = settings.uuids;
+    var rawAssets = settings.rawAssets;
+    var assetTypes = settings.assetTypes;
+    var realRawAssets = settings.rawAssets = {};
+    for (var mount in rawAssets) {
+        var entries = rawAssets[mount];
+        var realEntries = realRawAssets[mount] = {};
+        for (var id in entries) {
+            var entry = entries[id];
+            var type = entry[1];
+            // retrieve minified raw asset
+            if (typeof type === 'number') {
+                entry[1] = assetTypes[type];
+            }
+            // retrieve uuid
+            realEntries[uuids[id] || id] = entry;
+        }
+    }
+    var scenes = settings.scenes;
+    for (var i = 0; i < scenes.length; ++i) {
+        var scene = scenes[i];
+        if (typeof scene.uuid === 'number') {
+            scene.uuid = uuids[scene.uuid];
+        }
+    }
+    var packedAssets = settings.packedAssets;
+    for (var packId in packedAssets) {
+        var packedIds = packedAssets[packId];
+        for (var j = 0; j < packedIds.length; ++j) {
+            if (typeof packedIds[j] === 'number') {
+                packedIds[j] = uuids[packedIds[j]];
+            }
+        }
+    }
+    var subpackages = settings.subpackages;
+    for (var subId in subpackages) {
+        var uuidArray = subpackages[subId].uuids;
+        if (uuidArray) {
+            for (var k = 0, l = uuidArray.length; k < l; k++) {
+                if (typeof uuidArray[k] === 'number') {
+                    uuidArray[k] = uuids[uuidArray[k]];
+                }
+            }
+        }
+    }
+
+    // asset library options
+    const assetOptions = {
+        libraryPath: 'res/import',
+        rawAssetsBase: 'res/raw-',
+        rawAssets: settings.rawAssets,
+        packedAssets: settings.packedAssets,
+        md5AssetsMap: settings.md5AssetsMap,
+        subPackages: settings.subpackages
+    };
+    const options = {
+        scenes: settings.scenes,
+        debugMode: settings.debug ? 1 : 3, // cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR,
+        showFPS: !false && settings.debug,
+        frameRate: 60,
+        groupList: settings.groupList,
+        collisionMatrix: settings.collisionMatrix,
+        renderPipeline: settings.renderPipeline,
+        adapter: prepare.findCanvas('GameCanvas'),
+        assetOptions,
+        customJointTextureLayouts: settings.customJointTextureLayouts || [],
+    };
+    return options;
+}
+
+// Load all project scripts (built by creator)
+function loadJsListModules(jsList) {
+    // jsList
+    var promise = Promise.resolve();
+    if (jsList) {
+        jsList.forEach(function (x) {
+            promise = promise.then(function () {
+                return prepare.loadIIFE(boot.jsListRoot + '/' + x);
+            });
+        });
+    }
+    return promise;
+}
+
+// Load all custom script bundles. Every bundle may contain one or more named registered SystemJS modules, with no module.
+function loadScriptPackages(scriptPackages) {
+    var loadBundlePromises = [];
+    if (scriptPackages) {
+        for (var iScriptPackage = 0; iScriptPackage < scriptPackages.length; ++iScriptPackage) {
+            loadBundlePromises.push(prepare.loadIIFE(scriptPackages[iScriptPackage]));
+        }
+    }
+    return Promise.all(loadBundlePromises);
+}
+
+var prepare = function() {
+    settings = window._CCSettings;
+    return Promise.resolve(prepare.engine ? prepare.engine() : void 0).then(function() {
+            return (boot.systemGlobal || System).import('cc');
+        }).then(function() {
+            var options = initOptions();
+            return new Promise(function (resolve, reject) {
+                let inited = cc.game.init(options);
+                inited ? resolve() : reject();
+            });
+        }).then(function() {
+            return loadScriptPackages(settings.scriptPackages);
+        });
+};
+
+// Define how to prepare engine so that 'cc' is valid to import.
+prepare.engine = void 0;
+// Define how to prepare IIFE modules.
+prepare.loadIIFE = void 0;
+// Adapter: find canvas
+prepare.findCanvas = void 0;
+// The root url from which we can load js list.
+boot.jsListRoot = 'src';
+// System JS global. Default to `globalThis.System`.
+boot.systemGlobal = undefined;
+boot.prepare = prepare;
+

文件差异内容过多而无法显示
+ 0 - 0
tools/qqbuild/src/system.bundle.js


部分文件因为文件数量过多而无法显示