├── 2.x_vorsion ├── dating.js ├── game.js ├── main.js └── updateDemo.zip ├── README.md ├── hall ├── .gitignore ├── assets │ ├── button_blue_big.png │ ├── button_blue_big.png.meta │ ├── hall.fire │ ├── hall.fire.meta │ ├── hall.js │ └── hall.js.meta ├── creator.d.ts ├── jsconfig.json ├── project.json └── settings │ ├── builder.json │ └── project.json └── subgame ├── .gitignore ├── 1.sh ├── README.md ├── assets ├── Scene.meta ├── Scene │ ├── helloworld.fire │ └── helloworld.fire.meta ├── Script.meta ├── Script │ ├── HelloWorld.js │ └── HelloWorld.js.meta ├── Texture.meta └── Texture │ ├── HelloWorld.png │ ├── HelloWorld.png.meta │ ├── singleColor.png │ └── singleColor.png.meta ├── creator.d.ts ├── dating.js ├── jsconfig.json ├── main.js ├── project.json ├── settings ├── builder.json ├── builder.panel.json └── project.json ├── template-banner.png ├── template.json ├── test.txt ├── version_generator.bat └── version_generator.js /2.x_vorsion/dating.js: -------------------------------------------------------------------------------- 1 | if (jsb) { 2 | var hotUpdateSearchPaths = localStorage.getItem('HotUpdateSearchPaths'); 3 | if (hotUpdateSearchPaths) { 4 | jsb.fileUtils.setSearchPaths(JSON.parse(hotUpdateSearchPaths)); 5 | } 6 | } 7 | cc.director.startAnimation(); 8 | 9 | window.boot = function () { 10 | 11 | 12 | 'use strict'; 13 | 14 | if (!cc.hall) { 15 | var isLoadedFlag = UpdateHelper.isDownloaded("hall");//是否下载过大厅 16 | cc.INGAME = isLoadedFlag ? ((jsb.fileUtils ? jsb.fileUtils.getWritablePath() : '/') + "update/hall/") : ""; 17 | require(cc.INGAME + 'src/settings.js'); 18 | _CCSettings = window._CCSettings; 19 | window._CCSettings = undefined; 20 | } else { 21 | _CCSettings = cc.hall; 22 | } 23 | 24 | 25 | var settings = _CCSettings; 26 | 27 | if ( !settings.debug ) { 28 | var uuids = settings.uuids; 29 | 30 | var rawAssets = settings.rawAssets; 31 | var assetTypes = settings.assetTypes; 32 | var realRawAssets = settings.rawAssets = {}; 33 | for (var mount in rawAssets) { 34 | var entries = rawAssets[mount]; 35 | var realEntries = realRawAssets[mount] = {}; 36 | for (var id in entries) { 37 | var entry = entries[id]; 38 | var type = entry[1]; 39 | // retrieve minified raw asset 40 | if (typeof type === 'number') { 41 | entry[1] = assetTypes[type]; 42 | } 43 | // retrieve uuid 44 | realEntries[uuids[id] || id] = entry; 45 | } 46 | } 47 | 48 | var scenes = settings.scenes; 49 | for (var i = 0; i < scenes.length; ++i) { 50 | var scene = scenes[i]; 51 | if (typeof scene.uuid === 'number') { 52 | scene.uuid = uuids[scene.uuid]; 53 | } 54 | } 55 | 56 | var packedAssets = settings.packedAssets; 57 | for (var packId in packedAssets) { 58 | var packedIds = packedAssets[packId]; 59 | for (var j = 0; j < packedIds.length; ++j) { 60 | if (typeof packedIds[j] === 'number') { 61 | packedIds[j] = uuids[packedIds[j]]; 62 | } 63 | } 64 | } 65 | } 66 | 67 | var onStart = function () { 68 | cc.loader.downloader._subpackages = settings.subpackages; 69 | 70 | cc.view.enableRetina(true); 71 | cc.view.resizeWithBrowserSize(true); 72 | 73 | if (!false && !false) { 74 | 75 | if (cc.sys.isMobile) { 76 | if (settings.orientation === 'landscape') { 77 | cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE); 78 | } 79 | else if (settings.orientation === 'portrait') { 80 | cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT); 81 | } 82 | cc.view.enableAutoFullScreen([ 83 | cc.sys.BROWSER_TYPE_BAIDU, 84 | cc.sys.BROWSER_TYPE_WECHAT, 85 | cc.sys.BROWSER_TYPE_MOBILE_QQ, 86 | cc.sys.BROWSER_TYPE_MIUI, 87 | ].indexOf(cc.sys.browserType) < 0); 88 | } 89 | 90 | 91 | } 92 | 93 | // init assets 94 | cc.AssetLibrary.init({ 95 | libraryPath: 'res/import', 96 | rawAssetsBase: 'res/raw-', 97 | rawAssets: settings.rawAssets, 98 | packedAssets: settings.packedAssets, 99 | md5AssetsMap: settings.md5AssetsMap 100 | }); 101 | 102 | var launchScene = "db://assets/hall/scenes/ChooseGame.fire"; 103 | 104 | // load scene 105 | cc.director.loadScene(launchScene, null, 106 | function () { 107 | cc.loader.onProgress = null; 108 | console.log('Success to load scene: ' + launchScene); 109 | } 110 | ); 111 | }; 112 | 113 | // jsList 114 | var jsList = settings.jsList; 115 | 116 | var bundledScript = settings.debug ? 'src/project.dev.js' : 'src/project.js'; 117 | if (jsList) { 118 | jsList = jsList.map(function (x) { 119 | return 'src/' + x; 120 | }); 121 | jsList.push(bundledScript); 122 | } 123 | else { 124 | jsList = [bundledScript]; 125 | } 126 | 127 | var option = { 128 | id: 'GameCanvas', 129 | scenes: settings.scenes, 130 | debugMode: settings.debug ? cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR, 131 | showFPS: !false && settings.debug, 132 | frameRate: 60, 133 | jsList: jsList, 134 | groupList: settings.groupList, 135 | collisionMatrix: settings.collisionMatrix, 136 | } 137 | 138 | cc.game.run(option, onStart); 139 | }; 140 | 141 | 142 | window.boot(); -------------------------------------------------------------------------------- /2.x_vorsion/game.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | /** 4 | * 1 原理,用子游戏的去包裹大厅的资源和代码,也可以用大厅包裹子游戏的思路 5 | * 2 中间可能会遇到的一些问题如下: 6 | * 2.1 之前的这种写法 7 | * if (cc && cc.sys.isNative) { 8 | let hotUpdateSearchPaths = cc.sys.localStorage.getItem('HotUpdateSearchPaths'); 9 | if (hotUpdateSearchPaths) { 10 | jsb.fileUtils.setSearchPaths(JSON.parse(hotUpdateSearchPaths)); 11 | } 12 | } 13 | 换成以下写法 14 | if (jsb) { 15 | var hotUpdateSearchPaths = localStorage.getItem('HotUpdateSearchPaths'); 16 | if (hotUpdateSearchPaths) { 17 | jsb.fileUtils.setSearchPaths(JSON.parse(hotUpdateSearchPaths)); 18 | } 19 | } 20 | 21 | * 2.2 切换子游戏时之前的 require(storagePath + "/src/main.js"); 要改为 window.require(storagePath + "/src/main.js"); //storagePath:子游戏存储路径 22 | 2.3 返回大厅时之前的 require(storagePath + "/src/dating.js"); 要改为 window.require(storagePath + "/src/dating.js"); //storagePath:子游戏存储路径 23 | 2.4 子游戏引用的资源需要预加载一下,否则无法成功引用 (!!!!这个bug 是针对安卓手机的!!!!!)如下: 24 | 1如果引用大厅的 prefab 可以这样处理一下 25 | var prePath = 'hall/prefabs/Dlgs/'; 26 | var ComPaths = { 27 | DlgSetting: prePath + 'DlgSetting' , 28 | DlgPlayerInfo: prePath + 'DlgPlayerInfo', 29 | DlgChat: prePath + 'DlgChat', 30 | DlgWebView: prePath + 'DlgWebView', 31 | PbVoiceState: prePathGameShares + 'PbVoiceState', 32 | PbClock: prePathGameShares + 'PbClock', 33 | PbGoldActionLayer: prePathGameShares + 'PbGoldActionLayer', 34 | 35 | }; 36 | module.exports.initHelper = function( cb ){ 37 | let loaded = 0 ; 38 | _.each( ComPaths , function( value , key ){ 39 | CCLoaderHelper.getRes( value , cc.Prefab , function (err, prefab) { 40 | cc.log( '@ PBHelper: <' + key + '> is loaded' ); 41 | loaded ++ ; 42 | if( loaded >= _.size( ComPaths ) ){ 43 | if( cb ) cb(); 44 | return ; 45 | } 46 | }); 47 | }); 48 | }; 49 | 2:如果引用大厅的动态图片比如人物头像可以这样处理: 50 | var HeadNum = 12; 51 | const prePathGameShares = 'hall/gameshares/'; 52 | module.exports.initHelper = function (cb){ 53 | let loaded = 0 ; 54 | for(let i = 0; i < HeadNum; i++){ 55 | let name = prePathGameShares + 'heads/head_' + i; 56 | cc.loader.loadRes(name, cc.SpriteFrame, (err, spriteFrame) => { 57 | if (err) { 58 | return cc.error(err.message || err); 59 | } 60 | loaded ++ ; 61 | if( loaded >= HeadNum ){ 62 | if( cb ) cb(); 63 | return ; 64 | } 65 | }); 66 | } 67 | 68 | } 69 | 2.5 如果当你预加载过大厅的prefab 后,即使能在子游戏里引用大厅的prefab ,但发现报错,问题很可能是你prefab 里有使用skeleton 动画,此时动画也需要预加载,或者尽量不去用动画 70 | 71 | 2.6 当你切换子游戏的时候在main.js 里合并 settings.assetTypes 时 ,别忘了 assetTypes 这个数组中资源类型的索引一定要和 大厅的settings.rawAssets.assets 资源的索引 子游戏里settings.rawAssets.assets资源的索引一致 72 | 这个时候就需要你重组 合并后的 settings.assetTypes,不然有些资源在切换子游戏后会某些资源不正常,例如 73 | 74 | 大厅的 setting 是 75 | rawAssets: { 76 | assets: { 77 | "52/GFrAb9P84BAfywQDVDA": ["hall/JSON/data/BCBMRooms01.json", 0], 78 | "6eWlAn9VBCTbFbLiWX1zMr": ["hall/audios/Chat/Boy/Chat_0.mp3", 1], 79 | f9djDJgiZN3o9EEpnFJeYf: ["hall/audios/turnOverAfter.mp3", 1], 80 | "0cFlRb/BlAZasIea/XxQqR": ["hall/gameshares/dealers/dealer_0", 2, 1], 81 | "a1G8DY2pJK3qTB9mEu+bbh": ["hall/gameshares/heads/head_9.png", 3], 82 | "a1GL100sxDZ7F9+Qfw5KWC": ["hall/gameshares/prefabs/PbBadgeView.prefab", 4], 83 | } 84 | }, 85 | assetTypes: ["cc.JsonAsset", "cc.AudioClip", "cc.SpriteFrame", "cc.Texture2D", "cc.Prefab"], 86 | 87 | 子游戏的 setting 是 88 | rawAssets: { 89 | assets: { 90 | "05GIMY+wtHEqGsMAsnZWZq": ["games/bcbm/audios/com/START_W.mp3", 0], 91 | } 92 | }, 93 | assetTypes: ["cc.AudioClip"], 94 | 95 | 所以你再合并 大厅和子游戏的 assets 时一定要把对应的 assetTypes 重组一下保证新的 assets里的资源 对应的 assetTypes 类型是对的 96 | 97 | */ 98 | 99 | ////////////////////////////以上这些是我做2.0.7的时候踩过的一些坑,可以参考一下//////////////////////////////////////////////////////////////// 100 | 101 | 102 | ///////////////////////////缺陷就是大厅的所有资源和代码必须在第一次打开游戏的时候进行一次更新,保证子游戏引用的永远是最新的大厅////////////////////////////////// 103 | 104 | // 具体的实现可以看dating.js 和 main.js 105 | 106 | //顺便配上大厅的 settings 和 子游戏的 settings 方便大家理解 107 | 108 | //大厅的 109 | 110 | window._CCSettings = { 111 | platform: "android", 112 | groupList: ["default", "Fish", "Bullet"], 113 | collisionMatrix: [ 114 | [false], 115 | [false, false, true], 116 | [false, true, false] 117 | ], 118 | rawAssets: { 119 | assets: { 120 | "52/GFrAb9P84BAfywQDVDA": ["hall/JSON/data/BCBMRooms01.json", 0], 121 | "f2+ua8PulCI5GlKI4G11FW": ["hall/JSON/data/BJLRooms01.json", 0], 122 | "7cOfzYZKdIIq7K6oR1sCyo": ["hall/JSON/data/BRNNRooms01.json", 0], 123 | "1dE3M9U5RHM5gqGhf2Z1aK": ["hall/JSON/data/DDZRooms01.json", 0], 124 | "b63Ici1mxA0I6wpo9K1Z+j": ["hall/JSON/data/DZRooms01.json", 0], 125 | a1EUTUcMJNq6UnGTNbuehZ: ["hall/JSON/data/FreeWheel.json", 0], 126 | a1ECn5ulNFLK3AbkcdlY6l: ["hall/JSON/data/Items.json", 0], 127 | cbXqhsp1RAN7ADuG5lZRzt: ["hall/JSON/data/LX9Rooms01.json", 0], 128 | a1ESqetKNCZLrOp8TTKVKC: ["hall/JSON/data/LuckyWheel.json", 0], 129 | a1GzOClmJITa7YLRc6eDZr: ["hall/JSON/data/PhoneCode.json", 0], 130 | cb0sNmAuBJQ62uuwZVBmXy: ["hall/JSON/data/RankRewardWfee.json", 0], 131 | a1Hf4kUPhGWKtLZFtZKSGF: ["hall/JSON/data/YTNNRooms01.json", 0], 132 | "3fiPOcuLpMDIwYuitixg8L": ["hall/JSON/data/YYBFRooms01.json", 0], 133 | "523pXYOeRFhJRzSm3Mh+oz": ["hall/JSON/data/ZJHRooms01.json", 0], 134 | "6eWlAn9VBCTbFbLiWX1zMr": ["hall/audios/Chat/Boy/Chat_0.mp3", 1], 135 | "49qIgw+NBH5YZvLksnHRMb": ["hall/audios/Chat/Boy/Chat_1.mp3", 1], 136 | "ac7pSrkmRMnq3Cd+jSN4/d": ["hall/audios/Chat/Boy/Chat_2.mp3", 1], 137 | "12TdXPUQ9Pi6iHMiUvpq1n": ["hall/audios/Chat/Boy/Chat_3.mp3", 1], 138 | "56iLTstUVLJolR7iLkroj4": ["hall/audios/Chat/Boy/Chat_4.mp3", 1], 139 | e2hYiw4oNB37IYZnr1EQFV: ["hall/audios/Chat/Boy/Chat_5.mp3", 1], 140 | dbZc5AoQBKxq9PYSS2icSt: ["hall/audios/Chat/Boy/Chat_6.mp3", 1], 141 | d6OGNleZxITIa8jFrsnXgq: ["hall/audios/Chat/Boy/Chat_7.mp3", 1], 142 | "15NJNIsVBKLY5kB88HnRpP": ["hall/audios/Chat/Boy/Chat_8.mp3", 1], 143 | "37XteSwmtH0JOYq+phDE4M": ["hall/audios/Chat/Boy/Chat_9.mp3", 1], 144 | "7eY6qvaoFEcZAJcin3FnBK": ["hall/audios/Chat/Girl/Chat_0.mp3", 1], 145 | "943nzhBXZFkY8LVbtYwZtD": ["hall/audios/Chat/Girl/Chat_1.mp3", 1], 146 | "5dWr/MAJRIQrsLuahDcwPx": ["hall/audios/Chat/Girl/Chat_2.mp3", 1], 147 | "76A0/fpmxBpI3p7eDXIRKe": ["hall/audios/Chat/Girl/Chat_3.mp3", 1], 148 | "77NYcN3olLUamSyDUOnUrJ": ["hall/audios/Chat/Girl/Chat_4.mp3", 1], 149 | "7b8DtucL9Mh45jKA/Vs0GP": ["hall/audios/Chat/Girl/Chat_5.mp3", 1], 150 | "c1ZpLKkaJDXIEddDD/zSw+": ["hall/audios/Chat/Girl/Chat_6.mp3", 1], 151 | ffJCLUAqZCe52JsXugrfc9: ["hall/audios/Chat/Girl/Chat_7.mp3", 1], 152 | "13jNSLe0RM1b+tBEZl+OUX": ["hall/audios/Chat/Girl/Chat_8.mp3", 1], 153 | "db1oWqlP5MybLNu2i+jbRC": ["hall/audios/Chat/Girl/Chat_9.mp3", 1], 154 | "21ynb3S/hCEJ7+18Wx8brb": ["hall/audios/audio_ui_click.mp3", 1], 155 | "8bIEt49ipDYJJE84GZfeeW": ["hall/audios/bg.mp3", 1], 156 | "7ca+tWV6lA7YTi1xBCrg7U": ["hall/audios/bg2.mp3", 1], 157 | "9dA/yzuDBG+YJHz6PT6Pyo": ["hall/audios/game/bcbm/bg.mp3", 1], 158 | ddhjQ544VP7IxzP88aVmO2: ["hall/audios/game/bjl/bg.mp3", 1], 159 | "27YsEuvTlCTJ1rYl7pwn2I": ["hall/audios/game/brnn/bg.mp3", 1], 160 | "2dtMfRJUJIEoXcie1R9OCp": ["hall/audios/game/ddz/bg.mp3", 1], 161 | "031RVPFNJH3pXX+lX7v+kX": ["hall/audios/game/dz/bg.mp3", 1], 162 | "45RFKPsKJN46KHY1qNdINw": ["hall/audios/game/ermj/bg.mp3", 1], 163 | "752LU00+xENK3H5QGGvieJ": ["hall/audios/game/lkpy/bg.mp3", 1], 164 | "da6/DvT49Oko9HL8AlUMKZ": ["hall/audios/game/lx9/bg.mp3", 1], 165 | "5dYbEZiaxNMqlGTZEvjCkx": ["hall/audios/game/nn/bg.mp3", 1], 166 | c6InoZTb9JUoWTneEr1blr: ["hall/audios/game/yybf/bg.mp3", 1], 167 | ad8w6AvQxF6qDAfIctNBYV: ["hall/audios/game/zjh/bg.mp3", 1], 168 | f9djDJgiZN3o9EEpnFJeYf: ["hall/audios/turnOverAfter.mp3", 1], 169 | "0cFlRb/BlAZasIea/XxQqR": ["hall/gameshares/dealers/dealer_0", 2, 1], 170 | "6f9j/XES9N5qG5k5p3ZD/g": ["hall/gameshares/dealers/dealer_0.png", 3], 171 | "03orBieVtN37KfFbxoyqtT": ["hall/gameshares/dealers/dealer_1", 2, 1], 172 | "eaj/sCPntKBJtBqIrAkzXj": ["hall/gameshares/dealers/dealer_1.png", 3], 173 | "3bhKDdWtlAAo8d/QfmJubd": ["hall/gameshares/dealers/dealer_2", 2, 1], 174 | "e4bRJCJc9GI6dntYou+Jcd": ["hall/gameshares/dealers/dealer_2.png", 3], 175 | "adQdLr+ntIaKMI0iKhlRjJ": ["hall/gameshares/dealers/dealer_3", 2, 1], 176 | fdR5oxu2tA2IRiUZu8bvGQ: ["hall/gameshares/dealers/dealer_3.png", 3], 177 | "f18u1CWdhF2YE/vlG3Fdt0": ["hall/gameshares/dealers/dealer_4", 2, 1], 178 | "f9X+3gmfREaIIL3c2d3QfW": ["hall/gameshares/dealers/dealer_4.png", 3], 179 | "fbPbSW/tZP9rNVtlZozvU9": ["hall/gameshares/dealers/dealer_5", 2, 1], 180 | "59t5vYEu9C5LEMe3gluUzG": ["hall/gameshares/dealers/dealer_5.png", 3], 181 | df68k7ye5LtKoZFUcnDesA: ["hall/gameshares/dealers/dealer_6", 2, 1], 182 | f9VcUr7xdKo5XGHMwKwNPS: ["hall/gameshares/dealers/dealer_6.png", 3], 183 | a1GUPA0eNLBZ4bDO5FQffT: ["hall/gameshares/heads/head_0", 2, 1], 184 | a1Fg7xRPFFjZUMvIyR1api: ["hall/gameshares/heads/head_0.png", 3], 185 | "a1EYOycFFAaLb8/hRVJ2ex": ["hall/gameshares/heads/head_1", 2, 1], 186 | a1H2lEjsZC7Zo8kODA0mQJ: ["hall/gameshares/heads/head_1.png", 3], 187 | "a1EHi+fWtIy4ExCvIYlqnP": ["hall/gameshares/heads/head_10", 2, 1], 188 | a1HdVWGB1AHpTFmePchBzr: ["hall/gameshares/heads/head_10.png", 3], 189 | a1E2FnvvNCMKvWtnKKtnSZ: ["hall/gameshares/heads/head_11", 2, 1], 190 | "a1G4vbxsNG6oRUldV3e8+S": ["hall/gameshares/heads/head_11.png", 3], 191 | a1EUf9hm5M8LBu7Vwhsfjb: ["hall/gameshares/heads/head_2", 2, 1], 192 | "a1HI80l+hICaT3B6hUHXMl": ["hall/gameshares/heads/head_2.png", 3], 193 | "a1F+wyNI5HJptb9BUDI2Xn": ["hall/gameshares/heads/head_3", 2, 1], 194 | "a1EyoeX85I+or2gi6W0g8/": ["hall/gameshares/heads/head_3.png", 3], 195 | "a1HLv3urZLM7aUPuMLdsc/": ["hall/gameshares/heads/head_4", 2, 1], 196 | a1FPf9ihxIH4vqrM3SdEm5: ["hall/gameshares/heads/head_4.png", 3], 197 | a1FYPLGMBGsLQdrNIEsDGc: ["hall/gameshares/heads/head_5", 2, 1], 198 | a1EqCwqlhAV7zNVovbSBaB: ["hall/gameshares/heads/head_5.png", 3], 199 | a1E3N0CvNNwoWUzhL7ReSM: ["hall/gameshares/heads/head_6", 2, 1], 200 | a1GKTjJlxAqrQnG0lwbZU5: ["hall/gameshares/heads/head_6.png", 3], 201 | "a1GC2lEDNEMb+U7yqVNtwQ": ["hall/gameshares/heads/head_7", 2, 1], 202 | a1E5TiBiNGQY0avTjLcqtb: ["hall/gameshares/heads/head_7.png", 3], 203 | a1FqaJOBxJmIXjAokXaYMi: ["hall/gameshares/heads/head_8", 2, 1], 204 | "a1HuuF87hLX7R/Ei1urZOi": ["hall/gameshares/heads/head_8.png", 3], 205 | a1EYaqBA1LtqIBgOOuqnrV: ["hall/gameshares/heads/head_9", 2, 1], 206 | "a1G8DY2pJK3qTB9mEu+bbh": ["hall/gameshares/heads/head_9.png", 3], 207 | "a1GL100sxDZ7F9+Qfw5KWC": ["hall/gameshares/prefabs/PbBadgeView.prefab", 4], 208 | "22JFc0prBPTIhKp9e9TEt3": ["hall/gameshares/prefabs/PbClock.prefab", 4], 209 | "9fu5y5DjNMdoBEVpomCPZ6": ["hall/gameshares/prefabs/PbGoldActionLayer.prefab", 4], 210 | a1NItIlSdOyLzyb0gYkJoQ: ["hall/gameshares/prefabs/PbVoiceState.prefab", 4], 211 | "29qc4A9TJARaAG9zwXfJU4": ["hall/gameshares/tables/table_0", 2, 1], 212 | "f2/6Tr9blDf6Tanko6IPmf": ["hall/gameshares/tables/table_0.png", 3], 213 | f5enKRGDVOI5srgIk0lhC7: ["hall/gameshares/tables/table_1", 2, 1], 214 | "4dowx15YtIGL7MQ/S3yi/y": ["hall/gameshares/tables/table_1.png", 3], 215 | "90JBo6InxAvp9jhACqyUg9": ["hall/gameshares/tables/table_2", 2, 1], 216 | ddE0tjhqZA6YTNszoemq3e: ["hall/gameshares/tables/table_2.png", 3], 217 | "8fpoz4iz1GnqAm4wjpIcBn": ["hall/gameshares/tables/table_3", 2, 1], 218 | "f22da+v5JHU4y3fJYiZhCr": ["hall/gameshares/tables/table_3.png", 3], 219 | "a1NLwDCq1P/4PZe9/jQ6/K": ["hall/gameshares/tables/table_bg", 2, 1], 220 | a1Ouzjau1AmL4IKlEcDTPN: ["hall/gameshares/tables/table_bg.png", 3], 221 | a2x10OfXZNmKZcKNvJe2hB: ["hall/gameshares/tables/table_bg1", 2, 1], 222 | "43aNfOBvNNPZ8nPGyTH2QF": ["hall/gameshares/tables/table_bg1.png", 3], 223 | e4A9PmOldLKIAO8vtC8WTN: ["hall/prefabs/Dlgs/DlgAccountSignIn.prefab", 4], 224 | "32fsiIXzNCU5kelFLoGQ/B": ["hall/prefabs/Dlgs/DlgBankCard.prefab", 4], 225 | b5I4aZPgRIErEjgpg2nPmU: ["hall/prefabs/Dlgs/DlgBankPop_up.prefab", 4], 226 | b95pXDb5JMRpIATUCn8msR: ["hall/prefabs/Dlgs/DlgBindAccount.prefab", 4], 227 | "67OuVjIbxGUZMrKA7xpVhZ": ["hall/prefabs/Dlgs/DlgBindAccountBank.prefab", 4], 228 | b4DoR73KhGa5BF1MtEagMz: ["hall/prefabs/Dlgs/DlgBindBankCard.prefab", 4], 229 | a1FeV0I8pOuacqJp9YTgMQ: ["hall/prefabs/Dlgs/DlgBindPhone.prefab", 4], 230 | "31SjpR5EZLDrCe2kSAem4m": ["hall/prefabs/Dlgs/DlgBindofGold.prefab", 4], 231 | a1HoffEdtPMJiPBLs2OBak: ["hall/prefabs/Dlgs/DlgBuyCard.prefab", 4], 232 | "97Y9nK+zNMiq5sfc6SmCto": ["hall/prefabs/Dlgs/DlgChangeBankPassword.prefab", 4], 233 | "62j1NNvmZLPY9ElcvILZZg": ["hall/prefabs/Dlgs/DlgChangePassword.prefab", 4], 234 | a1Gd4bJhJFl5uxR4SrrFwo: ["hall/prefabs/Dlgs/DlgCharge.prefab", 4], 235 | a1Fm0rda9IUa9W5QjWY0Mg: ["hall/prefabs/Dlgs/DlgChat.prefab", 4], 236 | "2eKzulXwNFBLLOARh81lUe": ["hall/prefabs/Dlgs/DlgChat2.prefab", 4], 237 | a1EsUTywdE5a8yNEDv7zE1: ["hall/prefabs/Dlgs/DlgCheckCode.prefab", 4], 238 | a1F109VXZMuYJvrJzX5vbI: ["hall/prefabs/Dlgs/DlgCreateRoom.prefab", 4], 239 | "018pHY3wJLepCvq4pSmd1Y": ["hall/prefabs/Dlgs/DlgExchange.prefab", 4], 240 | "06DlTkA2dOQZEQ+SvR9wU4": ["hall/prefabs/Dlgs/DlgFeedBack.prefab", 4], 241 | "22NfZ7tgtJvrubXzS5uEc4": ["hall/prefabs/Dlgs/DlgGameNeedDownload.prefab", 4], 242 | "7fiQUQCuNBWK0oZnDstDB7": ["hall/prefabs/Dlgs/DlgGetCandy.prefab", 4], 243 | "a1G7k+J3ZLYaQofgefsi7Z": ["hall/prefabs/Dlgs/DlgGetItems.prefab", 4], 244 | "a1GxjFRZVC/I8nCkN4S6sl": ["hall/prefabs/Dlgs/DlgGiveDiamonds.prefab", 4], 245 | a1GkGbdTBAc6HBnlZWa0CZ: ["hall/prefabs/Dlgs/DlgGiveDiamondsHistory.prefab", 4], 246 | a1Gkbxp4BAX7BHvQNwIS1G: ["hall/prefabs/Dlgs/DlgHeads.prefab", 4], 247 | a1GKzKMTtGp68xFjpUKX80: ["hall/prefabs/Dlgs/DlgHelp.prefab", 4], 248 | a1FQR1B0BKkp7v9ArcGimm: ["hall/prefabs/Dlgs/DlgHistory.prefab", 4], 249 | a1FDanixZPd7K55UvE0fZr: ["hall/prefabs/Dlgs/DlgInvitationDetails.prefab", 4], 250 | "a1HVhjogVIOo4T1tJ/XjSW": ["hall/prefabs/Dlgs/DlgInviteBind.prefab", 4], 251 | "a1ENM+eGRBGaecSR+Oz49P": ["hall/prefabs/Dlgs/DlgJoinRoom.prefab", 4], 252 | "a1GDJN2ktErYE8H+pVHxGB": ["hall/prefabs/Dlgs/DlgJoinRoom2.prefab", 4], 253 | a1FIh4m6VJbZYA5FISJP8h: ["hall/prefabs/Dlgs/DlgLuckyWheel.prefab", 4], 254 | "a1E2Wl8INO27Gq//10ZM2s": ["hall/prefabs/Dlgs/DlgMails.prefab", 4], 255 | "a1GhTfi5JN+I1grYGKCI6E": ["hall/prefabs/Dlgs/DlgMyWallet.prefab", 4], 256 | "a1G6iHNB1AUpKl/tPGUH1H": ["hall/prefabs/Dlgs/DlgNotice2.prefab", 4], 257 | a1Ey4qzadMKa0QPLwaFCmV: ["hall/prefabs/Dlgs/DlgNotice3.prefab", 4], 258 | "273S8KGvdJpLWw0zGjuB2s": ["hall/prefabs/Dlgs/DlgOfficialRecharge.prefab", 4], 259 | a1GNKUC4ZKXbTsLmYCVYIA: ["hall/prefabs/Dlgs/DlgPhoneRegister.prefab", 4], 260 | a1FWNS1ItEq5K28j09AQ1u: ["hall/prefabs/Dlgs/DlgPlayerInfo.prefab", 4], 261 | e25CBHVT5EEZrsYIoJM1Fz: ["hall/prefabs/Dlgs/DlgPlayerInfoNew.prefab", 4], 262 | f3mgwpfbxEp59vHIVYWKaw: ["hall/prefabs/Dlgs/DlgPresent.prefab", 4], 263 | "2ePI/IBEBFPJxSSEKaJdW7": ["hall/prefabs/Dlgs/DlgProperty.prefab", 4], 264 | "89DQhEOP9JypP9DAhMnPbP": ["hall/prefabs/Dlgs/DlgPublicNotice.prefab", 4], 265 | "99998W2ONJyJSfbUn/LpDl": ["hall/prefabs/Dlgs/DlgRankRewardMain.prefab", 4], 266 | "70viz2fPxH+K7NZ1ghRv70": ["hall/prefabs/Dlgs/DlgReConnect.prefab", 4], 267 | "325B8t2bhEyY6iYq5U8Ko0": ["hall/prefabs/Dlgs/DlgRechargeRecord.prefab", 4], 268 | "48r3NrYCZCeqTEBUKUFmKr": ["hall/prefabs/Dlgs/DlgRechargeTips.prefab", 4], 269 | db37XG3vVNn4o5gSyrLQnU: ["hall/prefabs/Dlgs/DlgReport.prefab", 4], 270 | f80t66wRBC3ZMMJlazW9nI: ["hall/prefabs/Dlgs/DlgRevisePasswoedNc.prefab", 4], 271 | a1G11L9iZMHLZfAQVRKLqw: ["hall/prefabs/Dlgs/DlgRevisePassword.prefab", 4], 272 | a1EIECddRPrKqHjulWfV8B: ["hall/prefabs/Dlgs/DlgService.prefab", 4], 273 | a1FaK4F1NBQaT0aIYxnBFA: ["hall/prefabs/Dlgs/DlgSetting.prefab", 4], 274 | a1ESchKm5EvbgxW5hmS91X: ["hall/prefabs/Dlgs/DlgShare.prefab", 4], 275 | a1FIc8riFJWKRbIM2Xg3l6: ["hall/prefabs/Dlgs/DlgShare2.prefab", 4], 276 | c3Z81PjzRPZ64fPvCyQ9MQ: ["hall/prefabs/Dlgs/DlgShareCode.prefab", 4], 277 | "35N1q1SLFH7KMpy/vZi56Q": ["hall/prefabs/Dlgs/DlgShareOut.prefab", 4], 278 | "f7ftMIz7NErZGwM+vMoVoC": ["hall/prefabs/Dlgs/DlgShareOutDetail.prefab", 4], 279 | "9aSNlesetMmod+W+ly6KsC": ["hall/prefabs/Dlgs/DlgShareOutHistory.prefab", 4], 280 | "9d6Dt0Vw5KzqLC1erOwSEL": ["hall/prefabs/Dlgs/DlgShareOutHistoryDetail.prefab", 4], 281 | "a1FRj+zBNNg6iiGnxrmK5p": ["hall/prefabs/Dlgs/DlgShareSpecQR.prefab", 4], 282 | fb0j75OX9OopBQPqKH7L1E: ["hall/prefabs/Dlgs/DlgShop.prefab", 4], 283 | b16zbNjv5F96KYivXFcmZL: ["hall/prefabs/Dlgs/DlgTime.prefab", 4], 284 | "a1F/PT7uBHt7+OqXptpnjq": ["hall/prefabs/Dlgs/DlgViewRoom.prefab", 4], 285 | "67iD7M8NhPJJf60IFApAld": ["hall/prefabs/Dlgs/DlgVipRechagre.prefab", 4], 286 | a1Ht83xrZBy4I5fkNf1o1N: ["hall/prefabs/Dlgs/DlgWalletConvert.prefab", 4], 287 | "15AiLm+PBAPqeBGv2NOjO/": ["hall/prefabs/Dlgs/DlgWalletOut.prefab", 4], 288 | "a1EH0N+NRBd7hNkGwLZvRx": ["hall/prefabs/Dlgs/DlgWalletRecharge.prefab", 4], 289 | a1ELipSd1PWoLAYeIMvFhu: ["hall/prefabs/Dlgs/DlgWalletRecordAll.prefab", 4], 290 | a1H9nShKdBJKTmqnQ5fyiM: ["hall/prefabs/Dlgs/DlgWalletRecordIn.prefab", 4], 291 | a1FWqgWjBK2Jt5UOJsjfAw: ["hall/prefabs/Dlgs/DlgWalletRecordOut.prefab", 4], 292 | a1FTDpXEJNTrj2aX2JduNd: ["hall/prefabs/Dlgs/DlgWalletToEth.prefab", 4], 293 | "a1H/OPohRMPbXx9qDUOwc5": ["hall/prefabs/Dlgs/DlgWalletWithdraw.prefab", 4], 294 | "56CKOrQihCs4bs8sRely6m": ["hall/prefabs/Dlgs/DlgWebRecharge.prefab", 4], 295 | a1H16Ha19Ex4phxkDYqFIk: ["hall/prefabs/Dlgs/DlgWebView.prefab", 4], 296 | fbo429b4pCJaZ0I7Z9QK5W: ["hall/prefabs/Dlgs/DlgWebViewService.prefab", 4], 297 | "9eRMmgskpM5ryLKnFExX+/": ["hall/prefabs/Dlgs/DlgYrBw.prefab", 4], 298 | "665O3BM39EOr2dIhX8YEWD": ["hall/prefabs/NodePools/ComChatSF.prefab", 4], 299 | "1ap1XHU29NG6SryP0A56v5": ["hall/prefabs/NodePools/PbBulletScreen.prefab", 4], 300 | a1HjKmGfdJ4bmZMAG8D2w8: ["hall/prefabs/NodePools/pbCard.prefab", 4], 301 | "4dXAuoZONCm7yBlTxCuv6T": ["hall/prefabs/NodePools/pbHeadLoading.prefab", 4], 302 | a1HMXOAOlIFKTV6klDYove: ["hall/prefabs/NodePools/pbLoading.prefab", 4], 303 | a1EeUdkwJEZ7v8ItVwarMC: ["hall/prefabs/NodePools/pbToast.prefab", 4], 304 | a1ERl9IINLeLNU0GKkxYOA: ["hall/prefabs/NodePools/pbTopInfo.prefab", 4], 305 | a1Gs6DnpRFOpKbqU4L3x5M: ["hall/prefabs/NodePools/pbTouchMask.prefab", 4] 306 | } 307 | }, 308 | assetTypes: ["cc.JsonAsset", "cc.AudioClip", "cc.SpriteFrame", "cc.Texture2D", "cc.Prefab"], 309 | launchScene: "db://assets/hall/scenes/LoadingScene.fire", 310 | scenes: [{ 311 | url: "db://assets/hall/scenes/LoadingScene.fire", 312 | uuid: "a1Hrj6Lb5MEapvpX2cXvCo" 313 | }, { 314 | url: "db://assets/hall/hallscene/BJLHallScene.fire", 315 | uuid: "0210Wo5f9BTZi0/MvzLY4T" 316 | }, { 317 | url: "db://assets/hall/hallscene/BRNNHallScene.fire", 318 | uuid: "64bIz63iNGJYmr/gwm2FQe" 319 | }, { 320 | url: "db://assets/hall/hallscene/ByHallScene.fire", 321 | uuid: "6dNHmR28ZGZLswejUIFS5n" 322 | }, { 323 | url: "db://assets/hall/hallscene/DDZHallScene.fire", 324 | uuid: "84GUazzxlE64QnjaBmtkIi" 325 | }, { 326 | url: "db://assets/hall/hallscene/DZHallScene.fire", 327 | uuid: "c31dJRSyZIVI4m0JHEHnYH" 328 | }, { 329 | url: "db://assets/hall/hallscene/ERMJHallScene.fire", 330 | uuid: "daHj2ui1tICLZ3a1SuaUM6" 331 | }, { 332 | url: "db://assets/hall/hallscene/LX9HallScene.fire", 333 | uuid: "6bsmqiB9JF86sTAWneY9JU" 334 | }, { 335 | url: "db://assets/hall/hallscene/NNHallScene.fire", 336 | uuid: "1aKgZHa4ZGXbw6rFv2mgKe" 337 | }, { 338 | url: "db://assets/hall/hallscene/StreetHallScene.fire", 339 | uuid: "b6EYMl0ahBvZVoYPtkFGTR" 340 | }, { 341 | url: "db://assets/hall/hallscene/ZJHHallScene.fire", 342 | uuid: "13oQr0T6hMC4lQqR+6c1J5" 343 | }, { 344 | url: "db://assets/hall/scenes/ChooseGame.fire", 345 | uuid: "a1EkHjzSZFCKo9lKDrM2cg" 346 | }, { 347 | url: "db://assets/hall/hallscene/BCBMHallScene.fire", 348 | uuid: "d1IHBKAARCt5EDMl085RSe" 349 | }, { 350 | url: "db://assets/hall/scenes/LoginScene.fire", 351 | uuid: "1cRJk0klNPNprj3Vfg+h2x" 352 | }, { 353 | url: "db://assets/hall/scenes/PreBackScene.fire", 354 | uuid: "b6a6Zt+x9GK53erD/cW4aC" 355 | }, { 356 | url: "db://assets/hall/scenes/PreLoadingScene.fire", 357 | uuid: "23uAOFZH1AZo2QmvynhWJf" 358 | }], 359 | packedAssets: {}, 360 | md5AssetsMap: {}, 361 | orientation: "", 362 | subpackages: {}, 363 | uuids: [] 364 | }; 365 | 366 | //子游戏的 367 | 368 | window._CCSettings = { 369 | platform: "android", 370 | groupList: ["default"], 371 | collisionMatrix: [ 372 | [true] 373 | ], 374 | rawAssets: { 375 | assets: { 376 | "05GIMY+wtHEqGsMAsnZWZq": ["games/bcbm/audios/com/START_W.mp3", 0], 377 | "1aOYMs8zNAt7LQTM9igkae": ["games/bcbm/audios/com/STOP_W.mp3", 0], 378 | "51gVxmvS5Kab9mbwPt1i7j": ["games/bcbm/audios/com/alert.mp3", 0], 379 | "03lk5GVetAxoG8DkgxGSqu": ["games/bcbm/audios/com/bcbm_bg.mp3", 0], 380 | "19Qz3FRBBLbp7P/Lke9zHL": ["games/bcbm/audios/com/bcbm_bg1.mp3", 0], 381 | e54WR8k9dIxq47VRbku6PC: ["games/bcbm/audios/com/bcbm_bg2.mp3", 0], 382 | "2edGEHGYtIvJwm3FApHf4L": ["games/bcbm/audios/com/bcbm_bg3.mp3", 0], 383 | "93bVlgAFVO1I5W/QT+fZTu": ["games/bcbm/audios/com/bcbm_end.mp3", 0], 384 | "e0AtPH0ZpM75YGuCxsps+r": ["games/bcbm/audios/com/bcbm_run_321.mp3", 0], 385 | "acUVi2hkdIK77buCr/Jls1": ["games/bcbm/audios/com/bcbm_run_begin.mp3", 0], 386 | "deU/sTeuFBB67RjQ/wT/Jg": ["games/bcbm/audios/com/bcbm_run_loop.mp3", 0], 387 | "17gevhrmtI+JqChidn1vGP": ["games/bcbm/audios/com/bcbm_score.mp3", 0], 388 | "213bLq6IdMI5HMZ9LOQo+7": ["games/bcbm/audios/com/bcbm_start.mp3", 0], 389 | "adEb5Zp3ZM1o+nXy+GWBM/": ["games/bcbm/audios/com/check.mp3", 0], 390 | a61ZPtx4pOn4F8FKfVV9zD: ["games/bcbm/audios/com/desk_allin_chip.mp3", 0], 391 | e7bjJocXRGNa8rjdrf4hn4: ["games/bcbm/audios/com/desk_flip_card.mp3", 0], 392 | "45964uvxBI1IF0tcAGllyd": ["games/bcbm/audios/com/desk_new_card.mp3", 0], 393 | a2cf0mljpNXJe3A4hPL8gc: ["games/bcbm/audios/com/desk_player_reminder.mp3", 0], 394 | "c3/53nTTNMMozY0KYx8W7u": ["games/bcbm/audios/com/desk_post_bet.mp3", 0], 395 | "26i01p/qpGKbVy1a7ffr/t": ["games/bcbm/audios/com/dispatch.mp3", 0], 396 | "2ebVgOy7FAELQ7gn1qx3mU": ["games/bcbm/audios/com/getChips.mp3", 0], 397 | faner4RT9IHqfCIPQ6efgW: ["games/bcbm/audios/com/lose.mp3", 0], 398 | edV9HjQeNL7pJLnlBfPupO: ["games/bcbm/audios/com/pushCard.mp3", 0], 399 | feJLsn0cxAip2DanOWTj0O: ["games/bcbm/audios/com/win.mp3", 0] 400 | } 401 | }, 402 | assetTypes: ["cc.AudioClip"], 403 | launchScene: "db://assets/games/bcbm/GameScene_BCBM.fire", 404 | scenes: [{ 405 | url: "db://assets/games/bcbm/GameScene_BCBM.fire", 406 | uuid: "a1asjHczpErqOGuhuJKynp" 407 | }], 408 | packedAssets: {}, 409 | md5AssetsMap: {}, 410 | orientation: "", 411 | subpackages: {}, 412 | uuids: [] 413 | }; 414 | -------------------------------------------------------------------------------- /2.x_vorsion/main.js: -------------------------------------------------------------------------------- 1 | 2 | //用子游戏去包裹大厅 3 | window.boot = function () { 4 | 5 | 6 | var _CCSettings = null; 7 | 8 | cc.INGAME = ""; 9 | cc.log(cc.INGAME); 10 | 11 | if (!cc.bcbm) { 12 | require(cc.INGAME + 'src/settings.js'); 13 | _CCSettings = window._CCSettings; 14 | window._CCSettings = undefined; 15 | require(cc.INGAME + 'src/' + (_CCSettings.debug ? 'project.dev.js' : 'project.js')); 16 | } else { 17 | _CCSettings = cc.bcbm; 18 | } 19 | 20 | var settings = _CCSettings; 21 | 22 | cc.bcbm = settings; 23 | // console.log('cc.bcbm', JSON.stringify(cc.bcbm)); 24 | 25 | var settingPath = (jsb.fileUtils ? jsb.fileUtils.getWritablePath() : '/') + "update/hall/"; 26 | window.require(settingPath + 'src/settings.js'); 27 | 28 | _CCSettings = window._CCSettings; 29 | window._CCSettings = undefined; 30 | 31 | var hallSetting = _CCSettings; 32 | 33 | ///////////////////////合并assetTypes(资源类型),重新配置settings.rawAssets.assets资源索引////////////////////////////// 34 | //例如:"05GIMY+wtHEqGsMAsnZWZq": ["games/bjl/audios/com/START_W.mp3", 0], 35 | var gameAssetTypes = settings.assetTypes; 36 | settings.assetTypes = hallSetting.assetTypes; 37 | 38 | //保证新的 settings.assetTypes 是大厅和子游戏的并集 39 | for(var typeIndex in gameAssetTypes){ 40 | var type = gameAssetTypes[typeIndex]; 41 | //不包含就塞到settings里面去 42 | if(settings.assetTypes.indexOf(type) == -1){ 43 | settings.assetTypes.push(type); 44 | } 45 | } 46 | //更改资源累心索引,保证合并后的资源类型是正确的 47 | for (var uuidKey in settings.rawAssets.assets) { 48 | 49 | var index = settings.rawAssets.assets[uuidKey][1]; 50 | var type1 = gameAssetTypes[index]; 51 | 52 | for(var typeIndex in settings.assetTypes){ 53 | 54 | var type2 = settings.assetTypes[typeIndex]; 55 | 56 | if(type1 == type2){ 57 | settings.rawAssets.assets[uuidKey][1] = parseInt(typeIndex);//这边莫名奇妙要 parseInt()一下,否则会报错 58 | } 59 | } 60 | 61 | } 62 | /////////////////////////////// end ///////////////////////////////////// 63 | 64 | for (var assetkey in hallSetting.packedAssets) { 65 | settings.packedAssets[assetkey] = hallSetting.packedAssets[assetkey]; 66 | } 67 | 68 | //动态资源合并 69 | for (var uuidKey in hallSetting.rawAssets.assets) { 70 | 71 | settings.rawAssets.assets[uuidKey] = hallSetting.rawAssets.assets[uuidKey]; 72 | } 73 | 74 | //场景合并 75 | for (var sceneKey in hallSetting.scenes) { 76 | settings.scenes.push(hallSetting.scenes[sceneKey]); 77 | } 78 | 79 | cc.hall = hallSetting; 80 | //console.log('cc.hall', JSON.stringify(cc.hall)); 81 | 82 | 83 | if ( !settings.debug ) { 84 | var uuids = settings.uuids; 85 | 86 | var rawAssets = settings.rawAssets; 87 | var assetTypes = settings.assetTypes; 88 | var realRawAssets = settings.rawAssets = {}; 89 | for (var mount in rawAssets) { 90 | var entries = rawAssets[mount]; 91 | var realEntries = realRawAssets[mount] = {}; 92 | for (var id in entries) { 93 | var entry = entries[id]; 94 | var type = entry[1]; 95 | // retrieve minified raw asset 96 | if (typeof type === 'number') { 97 | entry[1] = assetTypes[type]; 98 | } 99 | // retrieve uuid 100 | realEntries[uuids[id] || id] = entry; 101 | } 102 | } 103 | 104 | var scenes = settings.scenes; 105 | for (var i = 0; i < scenes.length; ++i) { 106 | var scene = scenes[i]; 107 | if (typeof scene.uuid === 'number') { 108 | scene.uuid = uuids[scene.uuid]; 109 | } 110 | } 111 | 112 | var packedAssets = settings.packedAssets; 113 | for (var packId in packedAssets) { 114 | var packedIds = packedAssets[packId]; 115 | for (var j = 0; j < packedIds.length; ++j) { 116 | if (typeof packedIds[j] === 'number') { 117 | packedIds[j] = uuids[packedIds[j]]; 118 | } 119 | } 120 | } 121 | } 122 | 123 | 124 | 125 | if ( !settings.debug ) { 126 | var uuids = settings.uuids; 127 | 128 | var rawAssets = settings.rawAssets; 129 | var assetTypes = settings.assetTypes; 130 | var realRawAssets = settings.rawAssets = {}; 131 | for (var mount in rawAssets) { 132 | var entries = rawAssets[mount]; 133 | var realEntries = realRawAssets[mount] = {}; 134 | for (var id in entries) { 135 | var entry = entries[id]; 136 | var type = entry[1]; 137 | // retrieve minified raw asset 138 | if (typeof type === 'number') { 139 | entry[1] = assetTypes[type]; 140 | } 141 | // retrieve uuid 142 | realEntries[uuids[id] || id] = entry; 143 | } 144 | } 145 | 146 | var scenes = settings.scenes; 147 | for (var i = 0; i < scenes.length; ++i) { 148 | var scene = scenes[i]; 149 | if (typeof scene.uuid === 'number') { 150 | scene.uuid = uuids[scene.uuid]; 151 | } 152 | } 153 | 154 | var packedAssets = settings.packedAssets; 155 | for (var packId in packedAssets) { 156 | var packedIds = packedAssets[packId]; 157 | for (var j = 0; j < packedIds.length; ++j) { 158 | if (typeof packedIds[j] === 'number') { 159 | packedIds[j] = uuids[packedIds[j]]; 160 | } 161 | } 162 | } 163 | } 164 | 165 | var onStart = function () { 166 | 167 | cc.loader.downloader._subpackages = settings.subpackages; 168 | 169 | cc.view.enableRetina(false); 170 | cc.view.resizeWithBrowserSize(true); 171 | 172 | 173 | if (!false && !false) { 174 | if (cc.sys.isMobile) { 175 | if (settings.orientation === 'landscape') { 176 | cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE); 177 | } 178 | else if (settings.orientation === 'portrait') { 179 | cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT); 180 | } 181 | cc.view.enableAutoFullScreen([ 182 | cc.sys.BROWSER_TYPE_BAIDU, 183 | cc.sys.BROWSER_TYPE_WECHAT, 184 | cc.sys.BROWSER_TYPE_MOBILE_QQ, 185 | cc.sys.BROWSER_TYPE_MIUI, 186 | ].indexOf(cc.sys.browserType) < 0); 187 | } 188 | 189 | } 190 | 191 | 192 | // init assets 193 | cc.AssetLibrary.init({ 194 | libraryPath: 'res/import', 195 | rawAssetsBase: 'res/raw-', 196 | rawAssets: settings.rawAssets, 197 | packedAssets: settings.packedAssets, 198 | md5AssetsMap: settings.md5AssetsMap 199 | }); 200 | 201 | 202 | 203 | var launchScene = settings.launchScene; 204 | // load scene 205 | cc.director.loadScene(launchScene, null, 206 | function () { 207 | GameMsgServer.sendJoinRoom(); 208 | cc.loader.onProgress = null; 209 | console.log('Success to load scene: ' + launchScene); 210 | } 211 | ); 212 | 213 | 214 | }; 215 | 216 | // jsList 217 | var jsList = settings.jsList; 218 | 219 | var bundledScript = settings.debug ? 'src/project.dev.js' : 'src/project.js'; 220 | if (jsList) { 221 | jsList = jsList.map(function (x) { 222 | return 'src/' + x; 223 | }); 224 | jsList.push(bundledScript); 225 | } 226 | else { 227 | jsList = [bundledScript]; 228 | } 229 | 230 | var option = { 231 | id: 'GameCanvas', 232 | scenes: settings.scenes, 233 | debugMode: settings.debug ? cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR, 234 | showFPS: !false && settings.debug, 235 | frameRate: 60, 236 | jsList: jsList, 237 | groupList: settings.groupList, 238 | collisionMatrix: settings.collisionMatrix, 239 | } 240 | 241 | cc.game.run(option, onStart); 242 | }; 243 | 244 | window.boot(); -------------------------------------------------------------------------------- /2.x_vorsion/updateDemo.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Leo501/HallAndGames/6cf9c661ddb9f697d0092fad663a077a26a73427/2.x_vorsion/updateDemo.zip -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HallAndGames 2 | 3 | #大厅+子游戏模式 4 | 5 | 1.x参考文章 6 | http://forum.cocos.com/t/topic/53115 7 | https://forum.cocos.com/t/1-5-2-demo/48200/16 8 | 注意 9 | https://forum.cocos.com/t/require-setting-js/68351 10 | 11 | 2.x参考文章 12 | https://forum.cocos.com/t/creator-2-0-7/73381 13 | 有问题可以加群:822735145 14 | 15 | 步骤 16 | * 修改hall与subgame中远程热更新地址 17 | * 用Cocos Creator打开工程subgame 点击构建发布(如果使用加密js 请修改密钥成hall所生成的密钥) 18 | * subgame构建完成后。请把subgame目录下的dating.js与main.js放到bulid所在对应模板如jsb-link or jsb-default 下的src目录下。 19 | * 复制两个文件后。开始到subgame目录下。使用version_generator.js 生成热更新文件 20 | * 生成热更新文件后。进入build\jsb-link or build\jsb-default。把目录res与src 跟文件peision.manifest还有version.manifest放到远程目录。 21 | * 用Cocos Creator打开工程hall 点击构建发布生成apk。就可以测试了 22 | 23 | # 分包模式 24 | ### 分离出大厅和子游戏的资源并分离 25 | * 参考文章 26 | https://forum.cocos.org/t/topic/74339 27 | github https://github.com/zPiggy/subpackage-tools 28 | 29 | ### assets-bundle插件基于官方的分包策略。 30 | * 参考文章 31 | https://forum.cocos.org/t/cocoscreator-assetsbundle/88349 32 | github https://github.com/zPiggy/assets-bundle 33 | -------------------------------------------------------------------------------- /hall/.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | library/ 6 | temp/ 7 | local/ 8 | build/ 9 | 10 | #///////////////////////////////////////////////////////////////////////////// 11 | # Logs and databases 12 | #///////////////////////////////////////////////////////////////////////////// 13 | 14 | *.log 15 | *.sql 16 | *.sqlite 17 | 18 | #///////////////////////////////////////////////////////////////////////////// 19 | # files for debugger 20 | #///////////////////////////////////////////////////////////////////////////// 21 | 22 | *.sln 23 | *.csproj 24 | *.pidb 25 | *.unityproj 26 | *.suo 27 | 28 | #///////////////////////////////////////////////////////////////////////////// 29 | # OS generated files 30 | #///////////////////////////////////////////////////////////////////////////// 31 | 32 | .DS_Store 33 | ehthumbs.db 34 | Thumbs.db 35 | 36 | #///////////////////////////////////////////////////////////////////////////// 37 | # exvim files 38 | #///////////////////////////////////////////////////////////////////////////// 39 | 40 | *UnityVS.meta 41 | *.err 42 | *.err.meta 43 | *.exvim 44 | *.exvim.meta 45 | *.vimentry 46 | *.vimentry.meta 47 | *.vimproject 48 | *.vimproject.meta 49 | .vimfiles.*/ 50 | .exvim.*/ 51 | quick_gen_project_*_autogen.bat 52 | quick_gen_project_*_autogen.bat.meta 53 | quick_gen_project_*_autogen.sh 54 | quick_gen_project_*_autogen.sh.meta 55 | .exvim.app 56 | 57 | #///////////////////////////////////////////////////////////////////////////// 58 | # webstorm files 59 | #///////////////////////////////////////////////////////////////////////////// 60 | 61 | .idea/ 62 | 63 | #////////////////////////// 64 | # VS Code 65 | #////////////////////////// 66 | 67 | .vscode/ -------------------------------------------------------------------------------- /hall/assets/button_blue_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Leo501/HallAndGames/6cf9c661ddb9f697d0092fad663a077a26a73427/hall/assets/button_blue_big.png -------------------------------------------------------------------------------- /hall/assets/button_blue_big.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "6df15c17-0365-4bbb-a9be-aa3d74b42bb2", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "button_blue_big": { 9 | "ver": "1.0.3", 10 | "uuid": "f63f4f0e-c3dc-413b-a1cd-d511dcfd4904", 11 | "rawTextureUuid": "6df15c17-0365-4bbb-a9be-aa3d74b42bb2", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 240, 20 | "height": 96, 21 | "rawWidth": 240, 22 | "rawHeight": 96, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /hall/assets/hall.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_objFlags": 0, 14 | "_parent": null, 15 | "_children": [ 16 | { 17 | "__id__": 2 18 | } 19 | ], 20 | "_tag": -1, 21 | "_active": true, 22 | "_components": [], 23 | "_prefab": null, 24 | "_id": "7bae9db5-5098-49b0-b306-bcf73c799a85", 25 | "_opacity": 255, 26 | "_color": { 27 | "__type__": "cc.Color", 28 | "r": 255, 29 | "g": 255, 30 | "b": 255, 31 | "a": 255 32 | }, 33 | "_cascadeOpacityEnabled": true, 34 | "_anchorPoint": { 35 | "__type__": "cc.Vec2", 36 | "x": 0, 37 | "y": 0 38 | }, 39 | "_contentSize": { 40 | "__type__": "cc.Size", 41 | "width": 0, 42 | "height": 0 43 | }, 44 | "_localZOrder": 0, 45 | "_globalZOrder": 0, 46 | "_opacityModifyRGB": false, 47 | "groupIndex": 0, 48 | "autoReleaseAssets": false 49 | }, 50 | { 51 | "__type__": "cc.Node", 52 | "_name": "Canvas", 53 | "_objFlags": 0, 54 | "_parent": { 55 | "__id__": 1 56 | }, 57 | "_children": [ 58 | { 59 | "__id__": 3 60 | }, 61 | { 62 | "__id__": 5 63 | }, 64 | { 65 | "__id__": 7 66 | }, 67 | { 68 | "__id__": 9 69 | }, 70 | { 71 | "__id__": 15 72 | }, 73 | { 74 | "__id__": 21 75 | } 76 | ], 77 | "_tag": -1, 78 | "_active": true, 79 | "_components": [ 80 | { 81 | "__id__": 23 82 | }, 83 | { 84 | "__id__": 24 85 | } 86 | ], 87 | "_prefab": null, 88 | "_id": "6586eno/fNEsJk1JvjO48un", 89 | "_opacity": 255, 90 | "_color": { 91 | "__type__": "cc.Color", 92 | "r": 255, 93 | "g": 255, 94 | "b": 255, 95 | "a": 255 96 | }, 97 | "_cascadeOpacityEnabled": true, 98 | "_anchorPoint": { 99 | "__type__": "cc.Vec2", 100 | "x": 0.5, 101 | "y": 0.5 102 | }, 103 | "_contentSize": { 104 | "__type__": "cc.Size", 105 | "width": 960, 106 | "height": 640 107 | }, 108 | "_rotationX": 0, 109 | "_rotationY": 0, 110 | "_scaleX": 1, 111 | "_scaleY": 1, 112 | "_position": { 113 | "__type__": "cc.Vec2", 114 | "x": 480, 115 | "y": 320 116 | }, 117 | "_skewX": 0, 118 | "_skewY": 0, 119 | "_localZOrder": 0, 120 | "_globalZOrder": 0, 121 | "_opacityModifyRGB": false, 122 | "groupIndex": 0 123 | }, 124 | { 125 | "__type__": "cc.Node", 126 | "_name": "title", 127 | "_objFlags": 0, 128 | "_parent": { 129 | "__id__": 2 130 | }, 131 | "_children": [], 132 | "_tag": -1, 133 | "_active": true, 134 | "_components": [ 135 | { 136 | "__id__": 4 137 | } 138 | ], 139 | "_prefab": null, 140 | "_id": "721d1bVnnRGgYWTxfRcIudq", 141 | "_opacity": 255, 142 | "_color": { 143 | "__type__": "cc.Color", 144 | "r": 255, 145 | "g": 255, 146 | "b": 255, 147 | "a": 255 148 | }, 149 | "_cascadeOpacityEnabled": true, 150 | "_anchorPoint": { 151 | "__type__": "cc.Vec2", 152 | "x": 0.5, 153 | "y": 0.5 154 | }, 155 | "_contentSize": { 156 | "__type__": "cc.Size", 157 | "width": 320, 158 | "height": 40 159 | }, 160 | "_rotationX": 0, 161 | "_rotationY": 0, 162 | "_scaleX": 1, 163 | "_scaleY": 1, 164 | "_position": { 165 | "__type__": "cc.Vec2", 166 | "x": 22, 167 | "y": 232 168 | }, 169 | "_skewX": 0, 170 | "_skewY": 0, 171 | "_localZOrder": 0, 172 | "_globalZOrder": 0, 173 | "_opacityModifyRGB": false, 174 | "groupIndex": 0 175 | }, 176 | { 177 | "__type__": "cc.Label", 178 | "_name": "", 179 | "_objFlags": 0, 180 | "node": { 181 | "__id__": 3 182 | }, 183 | "_enabled": true, 184 | "_useOriginalSize": false, 185 | "_actualFontSize": 40, 186 | "_fontSize": 40, 187 | "_lineHeight": 40, 188 | "_enableWrapText": true, 189 | "_N$file": null, 190 | "_isSystemFontUsed": true, 191 | "_spacingX": 0, 192 | "_N$string": "这是一个游戏大厅", 193 | "_N$horizontalAlign": 1, 194 | "_N$verticalAlign": 1, 195 | "_N$fontFamily": "Arial", 196 | "_N$overflow": 0 197 | }, 198 | { 199 | "__type__": "cc.Node", 200 | "_name": "tip", 201 | "_objFlags": 0, 202 | "_parent": { 203 | "__id__": 2 204 | }, 205 | "_children": [], 206 | "_tag": -1, 207 | "_active": true, 208 | "_components": [ 209 | { 210 | "__id__": 6 211 | } 212 | ], 213 | "_prefab": null, 214 | "_id": "22f9aQJTyFB2agTa38/IDCY", 215 | "_opacity": 255, 216 | "_color": { 217 | "__type__": "cc.Color", 218 | "r": 255, 219 | "g": 255, 220 | "b": 255, 221 | "a": 255 222 | }, 223 | "_cascadeOpacityEnabled": true, 224 | "_anchorPoint": { 225 | "__type__": "cc.Vec2", 226 | "x": 0.5, 227 | "y": 0.5 228 | }, 229 | "_contentSize": { 230 | "__type__": "cc.Size", 231 | "width": 208.96, 232 | "height": 40 233 | }, 234 | "_rotationX": 0, 235 | "_rotationY": 0, 236 | "_scaleX": 1, 237 | "_scaleY": 1, 238 | "_position": { 239 | "__type__": "cc.Vec2", 240 | "x": 30, 241 | "y": 0 242 | }, 243 | "_skewX": 0, 244 | "_skewY": 0, 245 | "_localZOrder": 0, 246 | "_globalZOrder": 0, 247 | "_opacityModifyRGB": false, 248 | "groupIndex": 0 249 | }, 250 | { 251 | "__type__": "cc.Label", 252 | "_name": "", 253 | "_objFlags": 0, 254 | "node": { 255 | "__id__": 5 256 | }, 257 | "_enabled": true, 258 | "_useOriginalSize": false, 259 | "_actualFontSize": 40, 260 | "_fontSize": 40, 261 | "_lineHeight": 40, 262 | "_enableWrapText": true, 263 | "_N$file": null, 264 | "_isSystemFontUsed": true, 265 | "_spacingX": 0, 266 | "_N$string": "Hello world!", 267 | "_N$horizontalAlign": 1, 268 | "_N$verticalAlign": 1, 269 | "_N$fontFamily": "Arial", 270 | "_N$overflow": 0 271 | }, 272 | { 273 | "__type__": "cc.Node", 274 | "_name": "label", 275 | "_objFlags": 0, 276 | "_parent": { 277 | "__id__": 2 278 | }, 279 | "_children": [], 280 | "_tag": -1, 281 | "_active": true, 282 | "_components": [ 283 | { 284 | "__id__": 8 285 | } 286 | ], 287 | "_prefab": null, 288 | "_id": "46a63huaF1KC5s7qGfYStOY", 289 | "_opacity": 255, 290 | "_color": { 291 | "__type__": "cc.Color", 292 | "r": 255, 293 | "g": 255, 294 | "b": 255, 295 | "a": 255 296 | }, 297 | "_cascadeOpacityEnabled": true, 298 | "_anchorPoint": { 299 | "__type__": "cc.Vec2", 300 | "x": 0.5, 301 | "y": 0.5 302 | }, 303 | "_contentSize": { 304 | "__type__": "cc.Size", 305 | "width": 88.98, 306 | "height": 40 307 | }, 308 | "_rotationX": 0, 309 | "_rotationY": 0, 310 | "_scaleX": 1, 311 | "_scaleY": 1, 312 | "_position": { 313 | "__type__": "cc.Vec2", 314 | "x": 15, 315 | "y": -79 316 | }, 317 | "_skewX": 0, 318 | "_skewY": 0, 319 | "_localZOrder": 0, 320 | "_globalZOrder": 0, 321 | "_opacityModifyRGB": false, 322 | "groupIndex": 0 323 | }, 324 | { 325 | "__type__": "cc.Label", 326 | "_name": "", 327 | "_objFlags": 0, 328 | "node": { 329 | "__id__": 7 330 | }, 331 | "_enabled": true, 332 | "_useOriginalSize": false, 333 | "_actualFontSize": 40, 334 | "_fontSize": 40, 335 | "_lineHeight": 40, 336 | "_enableWrapText": true, 337 | "_N$file": null, 338 | "_isSystemFontUsed": true, 339 | "_spacingX": 0, 340 | "_N$string": "oooo", 341 | "_N$horizontalAlign": 1, 342 | "_N$verticalAlign": 1, 343 | "_N$fontFamily": "Arial", 344 | "_N$overflow": 0 345 | }, 346 | { 347 | "__type__": "cc.Node", 348 | "_name": "btn_download", 349 | "_objFlags": 0, 350 | "_parent": { 351 | "__id__": 2 352 | }, 353 | "_children": [ 354 | { 355 | "__id__": 10 356 | } 357 | ], 358 | "_tag": -1, 359 | "_active": true, 360 | "_components": [ 361 | { 362 | "__id__": 12 363 | }, 364 | { 365 | "__id__": 13 366 | } 367 | ], 368 | "_prefab": null, 369 | "_id": "d445cqYOO1EXoWyRpsL3bfb", 370 | "_opacity": 255, 371 | "_color": { 372 | "__type__": "cc.Color", 373 | "r": 255, 374 | "g": 255, 375 | "b": 255, 376 | "a": 255 377 | }, 378 | "_cascadeOpacityEnabled": true, 379 | "_anchorPoint": { 380 | "__type__": "cc.Vec2", 381 | "x": 0.5, 382 | "y": 0.5 383 | }, 384 | "_contentSize": { 385 | "__type__": "cc.Size", 386 | "width": 100, 387 | "height": 40 388 | }, 389 | "_rotationX": 0, 390 | "_rotationY": 0, 391 | "_scaleX": 1, 392 | "_scaleY": 1, 393 | "_position": { 394 | "__type__": "cc.Vec2", 395 | "x": -137, 396 | "y": -143 397 | }, 398 | "_skewX": 0, 399 | "_skewY": 0, 400 | "_localZOrder": 0, 401 | "_globalZOrder": 0, 402 | "_opacityModifyRGB": false, 403 | "groupIndex": 0 404 | }, 405 | { 406 | "__type__": "cc.Node", 407 | "_name": "Label", 408 | "_objFlags": 0, 409 | "_parent": { 410 | "__id__": 9 411 | }, 412 | "_children": [], 413 | "_tag": -1, 414 | "_active": true, 415 | "_components": [ 416 | { 417 | "__id__": 11 418 | } 419 | ], 420 | "_prefab": null, 421 | "_id": "74b37+eTTtPh4mJoZDCv1gA", 422 | "_opacity": 255, 423 | "_color": { 424 | "__type__": "cc.Color", 425 | "r": 0, 426 | "g": 0, 427 | "b": 0, 428 | "a": 255 429 | }, 430 | "_cascadeOpacityEnabled": true, 431 | "_anchorPoint": { 432 | "__type__": "cc.Vec2", 433 | "x": 0.5, 434 | "y": 0.5 435 | }, 436 | "_contentSize": { 437 | "__type__": "cc.Size", 438 | "width": 120, 439 | "height": 40 440 | }, 441 | "_rotationX": 0, 442 | "_rotationY": 0, 443 | "_scaleX": 1, 444 | "_scaleY": 1, 445 | "_position": { 446 | "__type__": "cc.Vec2", 447 | "x": 0, 448 | "y": 0 449 | }, 450 | "_skewX": 0, 451 | "_skewY": 0, 452 | "_localZOrder": 0, 453 | "_globalZOrder": 0, 454 | "_opacityModifyRGB": false, 455 | "groupIndex": 0 456 | }, 457 | { 458 | "__type__": "cc.Label", 459 | "_name": "", 460 | "_objFlags": 0, 461 | "node": { 462 | "__id__": 10 463 | }, 464 | "_enabled": true, 465 | "_useOriginalSize": false, 466 | "_actualFontSize": 20, 467 | "_fontSize": 20, 468 | "_lineHeight": 40, 469 | "_enableWrapText": false, 470 | "_N$file": null, 471 | "_isSystemFontUsed": true, 472 | "_spacingX": 0, 473 | "_N$string": "下载子游戏", 474 | "_N$horizontalAlign": 1, 475 | "_N$verticalAlign": 1, 476 | "_N$fontFamily": "Arial", 477 | "_N$overflow": 1 478 | }, 479 | { 480 | "__type__": "cc.Sprite", 481 | "_name": "", 482 | "_objFlags": 0, 483 | "node": { 484 | "__id__": 9 485 | }, 486 | "_enabled": true, 487 | "_spriteFrame": { 488 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 489 | }, 490 | "_type": 1, 491 | "_sizeMode": 0, 492 | "_fillType": 0, 493 | "_fillCenter": { 494 | "__type__": "cc.Vec2", 495 | "x": 0, 496 | "y": 0 497 | }, 498 | "_fillStart": 0, 499 | "_fillRange": 0, 500 | "_isTrimmedMode": true, 501 | "_srcBlendFactor": 770, 502 | "_dstBlendFactor": 771, 503 | "_atlas": null 504 | }, 505 | { 506 | "__type__": "cc.Button", 507 | "_name": "", 508 | "_objFlags": 0, 509 | "node": { 510 | "__id__": 9 511 | }, 512 | "_enabled": true, 513 | "transition": 2, 514 | "pressedColor": { 515 | "__type__": "cc.Color", 516 | "r": 255, 517 | "g": 255, 518 | "b": 255, 519 | "a": 255 520 | }, 521 | "hoverColor": { 522 | "__type__": "cc.Color", 523 | "r": 255, 524 | "g": 255, 525 | "b": 255, 526 | "a": 255 527 | }, 528 | "duration": 0.1, 529 | "zoomScale": 1.2, 530 | "pressedSprite": { 531 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 532 | }, 533 | "hoverSprite": { 534 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 535 | }, 536 | "clickEvents": [ 537 | { 538 | "__id__": 14 539 | } 540 | ], 541 | "_N$interactable": true, 542 | "_N$enableAutoGrayEffect": false, 543 | "_N$normalColor": { 544 | "__type__": "cc.Color", 545 | "r": 255, 546 | "g": 255, 547 | "b": 255, 548 | "a": 255 549 | }, 550 | "_N$disabledColor": { 551 | "__type__": "cc.Color", 552 | "r": 255, 553 | "g": 255, 554 | "b": 255, 555 | "a": 255 556 | }, 557 | "_N$normalSprite": { 558 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 559 | }, 560 | "_N$disabledSprite": { 561 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 562 | }, 563 | "_N$target": { 564 | "__id__": 9 565 | } 566 | }, 567 | { 568 | "__type__": "cc.ClickEvent", 569 | "target": { 570 | "__id__": 2 571 | }, 572 | "component": "hall", 573 | "handler": "download_sub_game", 574 | "customEventData": "" 575 | }, 576 | { 577 | "__type__": "cc.Node", 578 | "_name": "btn_enter", 579 | "_objFlags": 0, 580 | "_parent": { 581 | "__id__": 2 582 | }, 583 | "_children": [ 584 | { 585 | "__id__": 16 586 | } 587 | ], 588 | "_tag": -1, 589 | "_active": true, 590 | "_components": [ 591 | { 592 | "__id__": 18 593 | }, 594 | { 595 | "__id__": 19 596 | } 597 | ], 598 | "_prefab": null, 599 | "_id": "93594GD3h9JdbI87daNQkxV", 600 | "_opacity": 255, 601 | "_color": { 602 | "__type__": "cc.Color", 603 | "r": 255, 604 | "g": 255, 605 | "b": 255, 606 | "a": 255 607 | }, 608 | "_cascadeOpacityEnabled": true, 609 | "_anchorPoint": { 610 | "__type__": "cc.Vec2", 611 | "x": 0.5, 612 | "y": 0.5 613 | }, 614 | "_contentSize": { 615 | "__type__": "cc.Size", 616 | "width": 100, 617 | "height": 40 618 | }, 619 | "_rotationX": 0, 620 | "_rotationY": 0, 621 | "_scaleX": 1, 622 | "_scaleY": 1, 623 | "_position": { 624 | "__type__": "cc.Vec2", 625 | "x": 170, 626 | "y": -143 627 | }, 628 | "_skewX": 0, 629 | "_skewY": 0, 630 | "_localZOrder": 0, 631 | "_globalZOrder": 0, 632 | "_opacityModifyRGB": false, 633 | "groupIndex": 0 634 | }, 635 | { 636 | "__type__": "cc.Node", 637 | "_name": "Label", 638 | "_objFlags": 0, 639 | "_parent": { 640 | "__id__": 15 641 | }, 642 | "_children": [], 643 | "_tag": -1, 644 | "_active": true, 645 | "_components": [ 646 | { 647 | "__id__": 17 648 | } 649 | ], 650 | "_prefab": null, 651 | "_id": "558129yyxBMn4wZfm0oZ3Zz", 652 | "_opacity": 255, 653 | "_color": { 654 | "__type__": "cc.Color", 655 | "r": 0, 656 | "g": 0, 657 | "b": 0, 658 | "a": 255 659 | }, 660 | "_cascadeOpacityEnabled": true, 661 | "_anchorPoint": { 662 | "__type__": "cc.Vec2", 663 | "x": 0.5, 664 | "y": 0.5 665 | }, 666 | "_contentSize": { 667 | "__type__": "cc.Size", 668 | "width": 100, 669 | "height": 40 670 | }, 671 | "_rotationX": 0, 672 | "_rotationY": 0, 673 | "_scaleX": 1, 674 | "_scaleY": 1, 675 | "_position": { 676 | "__type__": "cc.Vec2", 677 | "x": 0, 678 | "y": 0 679 | }, 680 | "_skewX": 0, 681 | "_skewY": 0, 682 | "_localZOrder": 0, 683 | "_globalZOrder": 0, 684 | "_opacityModifyRGB": false, 685 | "groupIndex": 0 686 | }, 687 | { 688 | "__type__": "cc.Label", 689 | "_name": "", 690 | "_objFlags": 0, 691 | "node": { 692 | "__id__": 16 693 | }, 694 | "_enabled": true, 695 | "_useOriginalSize": false, 696 | "_actualFontSize": 20, 697 | "_fontSize": 20, 698 | "_lineHeight": 40, 699 | "_enableWrapText": false, 700 | "_N$file": null, 701 | "_isSystemFontUsed": true, 702 | "_spacingX": 0, 703 | "_N$string": "进入子游戏", 704 | "_N$horizontalAlign": 1, 705 | "_N$verticalAlign": 1, 706 | "_N$fontFamily": "Arial", 707 | "_N$overflow": 1 708 | }, 709 | { 710 | "__type__": "cc.Sprite", 711 | "_name": "", 712 | "_objFlags": 0, 713 | "node": { 714 | "__id__": 15 715 | }, 716 | "_enabled": true, 717 | "_spriteFrame": { 718 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 719 | }, 720 | "_type": 1, 721 | "_sizeMode": 0, 722 | "_fillType": 0, 723 | "_fillCenter": { 724 | "__type__": "cc.Vec2", 725 | "x": 0, 726 | "y": 0 727 | }, 728 | "_fillStart": 0, 729 | "_fillRange": 0, 730 | "_isTrimmedMode": true, 731 | "_srcBlendFactor": 770, 732 | "_dstBlendFactor": 771, 733 | "_atlas": null 734 | }, 735 | { 736 | "__type__": "cc.Button", 737 | "_name": "", 738 | "_objFlags": 0, 739 | "node": { 740 | "__id__": 15 741 | }, 742 | "_enabled": true, 743 | "transition": 2, 744 | "pressedColor": { 745 | "__type__": "cc.Color", 746 | "r": 255, 747 | "g": 255, 748 | "b": 255, 749 | "a": 255 750 | }, 751 | "hoverColor": { 752 | "__type__": "cc.Color", 753 | "r": 255, 754 | "g": 255, 755 | "b": 255, 756 | "a": 255 757 | }, 758 | "duration": 0.1, 759 | "zoomScale": 1.2, 760 | "pressedSprite": { 761 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 762 | }, 763 | "hoverSprite": { 764 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 765 | }, 766 | "clickEvents": [ 767 | { 768 | "__id__": 20 769 | } 770 | ], 771 | "_N$interactable": true, 772 | "_N$enableAutoGrayEffect": false, 773 | "_N$normalColor": { 774 | "__type__": "cc.Color", 775 | "r": 255, 776 | "g": 255, 777 | "b": 255, 778 | "a": 255 779 | }, 780 | "_N$disabledColor": { 781 | "__type__": "cc.Color", 782 | "r": 255, 783 | "g": 255, 784 | "b": 255, 785 | "a": 255 786 | }, 787 | "_N$normalSprite": { 788 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 789 | }, 790 | "_N$disabledSprite": { 791 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 792 | }, 793 | "_N$target": { 794 | "__id__": 15 795 | } 796 | }, 797 | { 798 | "__type__": "cc.ClickEvent", 799 | "target": { 800 | "__id__": 2 801 | }, 802 | "component": "hall", 803 | "handler": "enter_sub_game", 804 | "customEventData": "" 805 | }, 806 | { 807 | "__type__": "cc.Node", 808 | "_name": "sp", 809 | "_objFlags": 0, 810 | "_parent": { 811 | "__id__": 2 812 | }, 813 | "_children": [], 814 | "_tag": -1, 815 | "_active": true, 816 | "_components": [ 817 | { 818 | "__id__": 22 819 | } 820 | ], 821 | "_prefab": null, 822 | "_id": "ded4fRVu9xMEKZBbKDXXkXt", 823 | "_opacity": 255, 824 | "_color": { 825 | "__type__": "cc.Color", 826 | "r": 255, 827 | "g": 255, 828 | "b": 255, 829 | "a": 255 830 | }, 831 | "_cascadeOpacityEnabled": true, 832 | "_anchorPoint": { 833 | "__type__": "cc.Vec2", 834 | "x": 0.5, 835 | "y": 0.5 836 | }, 837 | "_contentSize": { 838 | "__type__": "cc.Size", 839 | "width": 240, 840 | "height": 96 841 | }, 842 | "_rotationX": 0, 843 | "_rotationY": 0, 844 | "_scaleX": 1, 845 | "_scaleY": 1, 846 | "_position": { 847 | "__type__": "cc.Vec2", 848 | "x": 27, 849 | "y": 98 850 | }, 851 | "_skewX": 0, 852 | "_skewY": 0, 853 | "_localZOrder": 0, 854 | "_globalZOrder": 0, 855 | "_opacityModifyRGB": false, 856 | "groupIndex": 0 857 | }, 858 | { 859 | "__type__": "cc.Sprite", 860 | "_name": "", 861 | "_objFlags": 0, 862 | "node": { 863 | "__id__": 21 864 | }, 865 | "_enabled": true, 866 | "_spriteFrame": { 867 | "__uuid__": "f63f4f0e-c3dc-413b-a1cd-d511dcfd4904" 868 | }, 869 | "_type": 0, 870 | "_sizeMode": 1, 871 | "_fillType": 0, 872 | "_fillCenter": { 873 | "__type__": "cc.Vec2", 874 | "x": 0, 875 | "y": 0 876 | }, 877 | "_fillStart": 0, 878 | "_fillRange": 0, 879 | "_isTrimmedMode": true, 880 | "_srcBlendFactor": 770, 881 | "_dstBlendFactor": 771, 882 | "_atlas": null 883 | }, 884 | { 885 | "__type__": "cc.Canvas", 886 | "_name": "", 887 | "_objFlags": 0, 888 | "node": { 889 | "__id__": 2 890 | }, 891 | "_enabled": true, 892 | "_designResolution": { 893 | "__type__": "cc.Size", 894 | "width": 960, 895 | "height": 640 896 | }, 897 | "_fitWidth": false, 898 | "_fitHeight": true 899 | }, 900 | { 901 | "__type__": "8ebd7eD5e1NmoM5ZJtztGi0", 902 | "_name": "", 903 | "_objFlags": 0, 904 | "node": { 905 | "__id__": 2 906 | }, 907 | "_enabled": true 908 | } 909 | ] -------------------------------------------------------------------------------- /hall/assets/hall.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "7bae9db5-5098-49b0-b306-bcf73c799a85", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /hall/assets/hall.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | // foo: { 6 | // default: null, // The default value will be used only when the component attaching 7 | // to a node for the first time 8 | // url: cc.Texture2D, // optional, default is typeof default 9 | // serializable: true, // optional, default is true 10 | // visible: true, // optional, default is true 11 | // displayName: 'Foo', // optional 12 | // readonly: false, // optional, default is false 13 | // }, 14 | // ... 15 | }, 16 | 17 | // use this for initialization 18 | onLoad: function() { 19 | 20 | }, 21 | 22 | // called every frame, uncomment this function to activate update callback 23 | // update: function (dt) { 24 | 25 | // }, 26 | 27 | //*************************子游戏demo 开始***************************// 28 | getfiles: function(name, mmm) { 29 | 30 | 31 | this._storagePath = ((jsb.fileUtils ? jsb.fileUtils.getWritablePath() : '/') + 'ALLGame/' + name); 32 | 33 | var UIRLFILE = "http://192.168.0.116/down/remote-assets/" + name; 34 | var filees = this._storagePath + "/peision.manifest"; 35 | this.manifestUrl = filees; 36 | 37 | var customManifestStr = JSON.stringify({ 38 | 39 | "packageUrl": UIRLFILE, 40 | "remoteManifestUrl": UIRLFILE + "/peision.manifest", 41 | "remoteVersionUrl": UIRLFILE + "/version.manifest", 42 | "version": "0.0.1", 43 | "assets": {}, 44 | "searchPaths": [] 45 | }); 46 | 47 | var versionCompareHandle = function(versionA, versionB) { 48 | var vA = versionA.split('.'); 49 | var vB = versionB.split('.'); 50 | for (var i = 0; i < vA.length; ++i) { 51 | var a = parseInt(vA[i]); 52 | var b = parseInt(vB[i] || 0); 53 | if (a === b) { 54 | continue; 55 | } else { 56 | return a - b; 57 | } 58 | } 59 | if (vB.length > vA.length) { 60 | return -1; 61 | } else { 62 | return 0; 63 | } 64 | }; 65 | 66 | this._am = new jsb.AssetsManager('', this._storagePath, versionCompareHandle); 67 | 68 | if (!cc.sys.ENABLE_GC_FOR_NATIVE_OBJECTS) { 69 | this._am.retain(); 70 | } 71 | 72 | this._am.setVerifyCallback(function(path, asset) { 73 | 74 | var compressed = asset.compressed; 75 | 76 | var expectedMD5 = asset.md5; 77 | 78 | var relativePath = asset.path; 79 | 80 | var size = asset.size; 81 | 82 | 83 | 84 | if (compressed) { 85 | 86 | return true; 87 | } else { 88 | 89 | return true; 90 | } 91 | }); 92 | 93 | 94 | if (cc.sys.os === cc.sys.OS_ANDROID) { 95 | 96 | this._am.setMaxConcurrentTask(2); 97 | } 98 | 99 | if (mmm == 1) { 100 | this._updateListener = new jsb.EventListenerAssetsManager(this._am, this.updateCb.bind(this)); 101 | 102 | } else { 103 | 104 | this._updateListener = new jsb.EventListenerAssetsManager(this._am, this.checkCb.bind(this)); 105 | 106 | } 107 | 108 | cc.eventManager.addListener(this._updateListener, 1); 109 | 110 | if (this._am.getState() === jsb.AssetsManager.State.UNINITED) { 111 | 112 | 113 | if (jsb.fileUtils.isFileExist(filees)) { 114 | this._am.loadLocalManifest(this.manifestUrl); 115 | } else { 116 | var manifest = new jsb.Manifest(customManifestStr, this._storagePath); 117 | this._am.loadLocalManifest(manifest, this._storagePath); 118 | } 119 | 120 | } 121 | 122 | if (mmm == 1) { 123 | 124 | this._shengji = true; 125 | this._am.update(); 126 | 127 | } else { 128 | 129 | this._am.checkUpdate(); 130 | this._shengji = false; 131 | } 132 | 133 | console.log("更新文件:" + filees); 134 | 135 | }, 136 | 137 | updateCb: function(event) { 138 | //console.log( "升级执行:"+event.getEventCode() ); 139 | 140 | switch (event.getEventCode()) { 141 | case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST: 142 | /*0 本地没有配置文件*/ 143 | break; 144 | 145 | case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST: 146 | /*1下载配置文件错误*/ 147 | break; 148 | 149 | case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST: 150 | /*2 解析文件错误*/ 151 | break; 152 | 153 | case jsb.EventAssetsManager.NEW_VERSION_FOUND: 154 | /*3发现新的更新*/ 155 | 156 | break; 157 | 158 | case jsb.EventAssetsManager.ALREADY_UP_TO_DATE: 159 | /*4 已经是最新的*/ 160 | 161 | break; 162 | 163 | case jsb.EventAssetsManager.UPDATE_PROGRESSION: 164 | /*5 最新进展 做 进度的*/ 165 | cc.find("Canvas/label").getComponent(cc.Label).string = event.getPercentByFile(); 166 | break; 167 | 168 | 169 | case jsb.EventAssetsManager.ASSET_UPDATED: 170 | /*6需要更新*/ 171 | 172 | 173 | break; 174 | 175 | case jsb.EventAssetsManager.ERROR_UPDATING: 176 | 177 | /*7更新错误*/ 178 | 179 | break; 180 | 181 | 182 | case jsb.EventAssetsManager.UPDATE_FINISHED: 183 | /*8更新完成*/ 184 | cc.find("Canvas/label").getComponent(cc.Label).string = "更新完成"; 185 | 186 | break; 187 | 188 | case jsb.EventAssetsManager.UPDATE_FAILED: 189 | /*9更新失败*/ 190 | 191 | 192 | this.getfiles("subgame", 1); 193 | 194 | break; 195 | 196 | case jsb.EventAssetsManager.ERROR_DECOMPRESS: 197 | /*10解压失败*/ 198 | 199 | break; 200 | 201 | } 202 | 203 | 204 | 205 | }, 206 | 207 | 208 | 209 | 210 | checkCb: function(event) { 211 | 212 | 213 | 214 | console.log("检测执行:" + event.getEventCode()); 215 | 216 | switch (event.getEventCode()) { 217 | case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST: 218 | 219 | /*0 本地没有配置文件*/ 220 | 221 | 222 | break; 223 | 224 | case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST: 225 | /*1下载配置文件错误*/ 226 | 227 | 228 | break; 229 | 230 | case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST: 231 | /*2 解析文件错误*/ 232 | 233 | break; 234 | 235 | case jsb.EventAssetsManager.NEW_VERSION_FOUND: 236 | /*3发现新的更新*/ 237 | 238 | this.getfiles("subgame", 1); 239 | 240 | 241 | 242 | break; 243 | 244 | case jsb.EventAssetsManager.ALREADY_UP_TO_DATE: 245 | /*4 已经是最新的*/ 246 | cc.find("Canvas/label").getComponent(cc.Label).string = "已经是最新的了!"; 247 | break; 248 | 249 | case jsb.EventAssetsManager.UPDATE_PROGRESSION: 250 | /*5 最新进展 做 进度的*/ 251 | 252 | 253 | 254 | 255 | break; 256 | 257 | 258 | case jsb.EventAssetsManager.ASSET_UPDATED: 259 | 260 | /*6需要更新*/ 261 | 262 | break; 263 | 264 | case jsb.EventAssetsManager.ERROR_UPDATING: 265 | 266 | /*7更新错误*/ 267 | 268 | break; 269 | 270 | 271 | case jsb.EventAssetsManager.UPDATE_FINISHED: 272 | /*8更新完成*/ 273 | 274 | 275 | break; 276 | case jsb.EventAssetsManager.UPDATE_FAILED: 277 | /*9更新失败*/ 278 | 279 | 280 | break; 281 | 282 | case jsb.EventAssetsManager.ERROR_DECOMPRESS: 283 | /*10解压失败*/ 284 | 285 | break; 286 | 287 | } 288 | 289 | 290 | 291 | }, 292 | 293 | download_sub_game: function() { 294 | this.getfiles("subgame", 2); 295 | }, 296 | 297 | enter_sub_game: function() { 298 | if (!this._storagePath) { 299 | cc.find("Canvas/label").getComponent(cc.Label).string = "请先点击下载游戏,检查版本是否更新!!!"; 300 | return; 301 | } 302 | 303 | require(this._storagePath + "/src/main.js"); 304 | }, 305 | //*************************子游戏demo 结束***************************// 306 | }); -------------------------------------------------------------------------------- /hall/assets/hall.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "8ebd7783-e5ed-4d9a-8339-649b73b468b4", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /hall/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /hall/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /hall/settings/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "appKey": "", 3 | "appSecret": "", 4 | "encryptJs": true, 5 | "excludeScenes": [], 6 | "includeAnySDK": false, 7 | "includeSDKBox": false, 8 | "inlineSpriteFrames": true, 9 | "inlineSpriteFrames_native": true, 10 | "jailbreakPlatform": false, 11 | "md5Cache": false, 12 | "mergeStartScene": false, 13 | "oauthLoginServer": "", 14 | "optimizeHotUpdate": false, 15 | "orientation": { 16 | "landscapeLeft": true, 17 | "landscapeRight": true, 18 | "portrait": false, 19 | "upsideDown": false 20 | }, 21 | "packageName": "org.cocos2d.hall", 22 | "privateKey": "", 23 | "renderMode": "0", 24 | "startScene": "7bae9db5-5098-49b0-b306-bcf73c799a85", 25 | "title": "hall", 26 | "webOrientation": "auto", 27 | "xxteaKey": "d7eed64e-50f7-43", 28 | "zipCompressJs": true, 29 | "wechatgame": { 30 | "appid": "wx6ac3f5090a6b99c5", 31 | "orientation": "portrait", 32 | "REMOTE_SERVER_ROOT": "", 33 | "subContext": "", 34 | "isSubdomain": false 35 | }, 36 | "qqplay": { 37 | "orientation": "portrait", 38 | "REMOTE_SERVER_ROOT": "" 39 | }, 40 | "fb-instant-games": {} 41 | } -------------------------------------------------------------------------------- /hall/settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "start-scene": "current", 3 | "group-list": [ 4 | "default" 5 | ], 6 | "collision-matrix": [ 7 | [ 8 | true 9 | ] 10 | ], 11 | "excluded-modules": [], 12 | "design-resolution-width": 960, 13 | "design-resolution-height": 640, 14 | "fit-width": false, 15 | "fit-height": true, 16 | "use-project-simulator-setting": false, 17 | "simulator-orientation": false, 18 | "use-customize-simulator": false, 19 | "simulator-resolution": { 20 | "width": 960, 21 | "height": 640 22 | }, 23 | "cocos-analytics": { 24 | "enable": false, 25 | "appID": "13798", 26 | "appSecret": "959b3ac0037d0f3c2fdce94f8421a9b2" 27 | } 28 | } -------------------------------------------------------------------------------- /subgame/.gitignore: -------------------------------------------------------------------------------- 1 | #///////////////////////////////////////////////////////////////////////////// 2 | # Fireball Projects 3 | #///////////////////////////////////////////////////////////////////////////// 4 | 5 | library/ 6 | temp/ 7 | local/ 8 | build/ 9 | 10 | #///////////////////////////////////////////////////////////////////////////// 11 | # Logs and databases 12 | #///////////////////////////////////////////////////////////////////////////// 13 | 14 | *.log 15 | *.sql 16 | *.sqlite 17 | 18 | #///////////////////////////////////////////////////////////////////////////// 19 | # files for debugger 20 | #///////////////////////////////////////////////////////////////////////////// 21 | 22 | *.sln 23 | *.csproj 24 | *.pidb 25 | *.unityproj 26 | *.suo 27 | 28 | #///////////////////////////////////////////////////////////////////////////// 29 | # OS generated files 30 | #///////////////////////////////////////////////////////////////////////////// 31 | 32 | .DS_Store 33 | ehthumbs.db 34 | Thumbs.db 35 | 36 | #///////////////////////////////////////////////////////////////////////////// 37 | # exvim files 38 | #///////////////////////////////////////////////////////////////////////////// 39 | 40 | *UnityVS.meta 41 | *.err 42 | *.err.meta 43 | *.exvim 44 | *.exvim.meta 45 | *.vimentry 46 | *.vimentry.meta 47 | *.vimproject 48 | *.vimproject.meta 49 | .vimfiles.*/ 50 | .exvim.*/ 51 | quick_gen_project_*_autogen.bat 52 | quick_gen_project_*_autogen.bat.meta 53 | quick_gen_project_*_autogen.sh 54 | quick_gen_project_*_autogen.sh.meta 55 | .exvim.app 56 | 57 | #///////////////////////////////////////////////////////////////////////////// 58 | # webstorm files 59 | #///////////////////////////////////////////////////////////////////////////// 60 | 61 | .idea/ 62 | 63 | #////////////////////////// 64 | # VS Code 65 | #////////////////////////// 66 | 67 | .vscode/ -------------------------------------------------------------------------------- /subgame/1.sh: -------------------------------------------------------------------------------- 1 | name=$1 && dirname $0&&cd `dirname $0` && pwd && node version_generator.js ${name} 2 | -------------------------------------------------------------------------------- /subgame/README.md: -------------------------------------------------------------------------------- 1 | # hello-world 2 | Hello world new project template. 3 | -------------------------------------------------------------------------------- /subgame/assets/Scene.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "29f52784-2fca-467b-92e7-8fd9ef8c57b7", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /subgame/assets/Scene/helloworld.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_rawFiles": null, 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_objFlags": 0, 14 | "_parent": null, 15 | "_children": [ 16 | { 17 | "__id__": 2 18 | } 19 | ], 20 | "_tag": -1, 21 | "_active": true, 22 | "_components": [], 23 | "_prefab": null, 24 | "_id": "2d2f792f-a40c-49bb-a189-ed176a246e49", 25 | "_opacity": 255, 26 | "_color": { 27 | "__type__": "cc.Color", 28 | "r": 255, 29 | "g": 255, 30 | "b": 255, 31 | "a": 255 32 | }, 33 | "_cascadeOpacityEnabled": true, 34 | "_anchorPoint": { 35 | "__type__": "cc.Vec2", 36 | "x": 0, 37 | "y": 0 38 | }, 39 | "_contentSize": { 40 | "__type__": "cc.Size", 41 | "width": 0, 42 | "height": 0 43 | }, 44 | "_localZOrder": 0, 45 | "_globalZOrder": 0, 46 | "_opacityModifyRGB": false, 47 | "groupIndex": 0, 48 | "autoReleaseAssets": false 49 | }, 50 | { 51 | "__type__": "cc.Node", 52 | "_name": "Canvas", 53 | "_objFlags": 0, 54 | "_parent": { 55 | "__id__": 1 56 | }, 57 | "_children": [ 58 | { 59 | "__id__": 3 60 | }, 61 | { 62 | "__id__": 6 63 | }, 64 | { 65 | "__id__": 8 66 | }, 67 | { 68 | "__id__": 10 69 | }, 70 | { 71 | "__id__": 12 72 | } 73 | ], 74 | "_tag": -1, 75 | "_active": true, 76 | "_components": [ 77 | { 78 | "__id__": 18 79 | }, 80 | { 81 | "__id__": 19 82 | } 83 | ], 84 | "_prefab": null, 85 | "_id": "a286bbGknJLZpRpxROV6M94", 86 | "_opacity": 255, 87 | "_color": { 88 | "__type__": "cc.Color", 89 | "r": 252, 90 | "g": 252, 91 | "b": 252, 92 | "a": 255 93 | }, 94 | "_cascadeOpacityEnabled": true, 95 | "_anchorPoint": { 96 | "__type__": "cc.Vec2", 97 | "x": 0.5, 98 | "y": 0.5 99 | }, 100 | "_contentSize": { 101 | "__type__": "cc.Size", 102 | "width": 960, 103 | "height": 640 104 | }, 105 | "_rotationX": 0, 106 | "_rotationY": 0, 107 | "_scaleX": 1, 108 | "_scaleY": 1, 109 | "_position": { 110 | "__type__": "cc.Vec2", 111 | "x": 480, 112 | "y": 320 113 | }, 114 | "_skewX": 0, 115 | "_skewY": 0, 116 | "_localZOrder": 0, 117 | "_globalZOrder": 0, 118 | "_opacityModifyRGB": false, 119 | "groupIndex": 0 120 | }, 121 | { 122 | "__type__": "cc.Node", 123 | "_name": "background", 124 | "_objFlags": 0, 125 | "_parent": { 126 | "__id__": 2 127 | }, 128 | "_children": [], 129 | "_tag": -1, 130 | "_active": true, 131 | "_components": [ 132 | { 133 | "__id__": 4 134 | }, 135 | { 136 | "__id__": 5 137 | } 138 | ], 139 | "_prefab": null, 140 | "_id": "e2e0crkOLxGrpMxpbC4iQg1", 141 | "_opacity": 255, 142 | "_color": { 143 | "__type__": "cc.Color", 144 | "r": 27, 145 | "g": 38, 146 | "b": 46, 147 | "a": 255 148 | }, 149 | "_cascadeOpacityEnabled": true, 150 | "_anchorPoint": { 151 | "__type__": "cc.Vec2", 152 | "x": 0.5, 153 | "y": 0.5 154 | }, 155 | "_contentSize": { 156 | "__type__": "cc.Size", 157 | "width": 960, 158 | "height": 640 159 | }, 160 | "_rotationX": 0, 161 | "_rotationY": 0, 162 | "_scaleX": 1, 163 | "_scaleY": 1, 164 | "_position": { 165 | "__type__": "cc.Vec2", 166 | "x": 0, 167 | "y": 0 168 | }, 169 | "_skewX": 0, 170 | "_skewY": 0, 171 | "_localZOrder": 0, 172 | "_globalZOrder": 0, 173 | "_opacityModifyRGB": false, 174 | "groupIndex": 0 175 | }, 176 | { 177 | "__type__": "cc.Widget", 178 | "_name": "", 179 | "_objFlags": 0, 180 | "node": { 181 | "__id__": 3 182 | }, 183 | "_enabled": true, 184 | "isAlignOnce": true, 185 | "_target": null, 186 | "_alignFlags": 45, 187 | "_left": 0, 188 | "_right": 0, 189 | "_top": 0, 190 | "_bottom": 0, 191 | "_verticalCenter": 0, 192 | "_horizontalCenter": 0, 193 | "_isAbsLeft": true, 194 | "_isAbsRight": true, 195 | "_isAbsTop": true, 196 | "_isAbsBottom": true, 197 | "_isAbsHorizontalCenter": true, 198 | "_isAbsVerticalCenter": true, 199 | "_originalWidth": 200, 200 | "_originalHeight": 150 201 | }, 202 | { 203 | "__type__": "cc.Sprite", 204 | "_name": "", 205 | "_objFlags": 0, 206 | "node": { 207 | "__id__": 3 208 | }, 209 | "_enabled": true, 210 | "_spriteFrame": { 211 | "__uuid__": "410fb916-8721-4663-bab8-34397391ace7" 212 | }, 213 | "_type": 1, 214 | "_sizeMode": 0, 215 | "_fillType": 0, 216 | "_fillCenter": { 217 | "__type__": "cc.Vec2", 218 | "x": 0, 219 | "y": 0 220 | }, 221 | "_fillStart": 0, 222 | "_fillRange": 0, 223 | "_isTrimmedMode": true, 224 | "_srcBlendFactor": 770, 225 | "_dstBlendFactor": 771, 226 | "_atlas": null 227 | }, 228 | { 229 | "__type__": "cc.Node", 230 | "_name": "cocos", 231 | "_objFlags": 0, 232 | "_parent": { 233 | "__id__": 2 234 | }, 235 | "_children": [], 236 | "_tag": -1, 237 | "_active": true, 238 | "_components": [ 239 | { 240 | "__id__": 7 241 | } 242 | ], 243 | "_prefab": null, 244 | "_id": "c4f30YOS65G64U2TwufdJ+2", 245 | "_opacity": 255, 246 | "_color": { 247 | "__type__": "cc.Color", 248 | "r": 255, 249 | "g": 255, 250 | "b": 255, 251 | "a": 255 252 | }, 253 | "_cascadeOpacityEnabled": true, 254 | "_anchorPoint": { 255 | "__type__": "cc.Vec2", 256 | "x": 0.5, 257 | "y": 0.5 258 | }, 259 | "_contentSize": { 260 | "__type__": "cc.Size", 261 | "width": 195, 262 | "height": 270 263 | }, 264 | "_rotationX": 0, 265 | "_rotationY": 0, 266 | "_scaleX": 1, 267 | "_scaleY": 1, 268 | "_position": { 269 | "__type__": "cc.Vec2", 270 | "x": 0, 271 | "y": 50 272 | }, 273 | "_skewX": 0, 274 | "_skewY": 0, 275 | "_localZOrder": 0, 276 | "_globalZOrder": 0, 277 | "_opacityModifyRGB": false, 278 | "groupIndex": 0 279 | }, 280 | { 281 | "__type__": "cc.Sprite", 282 | "_name": "", 283 | "_objFlags": 0, 284 | "node": { 285 | "__id__": 6 286 | }, 287 | "_enabled": true, 288 | "_spriteFrame": { 289 | "__uuid__": "31bc895a-c003-4566-a9f3-2e54ae1c17dc" 290 | }, 291 | "_type": 0, 292 | "_sizeMode": 1, 293 | "_fillType": 0, 294 | "_fillCenter": { 295 | "__type__": "cc.Vec2", 296 | "x": 0, 297 | "y": 0 298 | }, 299 | "_fillStart": 0, 300 | "_fillRange": 0, 301 | "_isTrimmedMode": true, 302 | "_srcBlendFactor": 770, 303 | "_dstBlendFactor": 771, 304 | "_atlas": null 305 | }, 306 | { 307 | "__type__": "cc.Node", 308 | "_name": "label", 309 | "_objFlags": 0, 310 | "_parent": { 311 | "__id__": 2 312 | }, 313 | "_children": [], 314 | "_tag": -1, 315 | "_active": true, 316 | "_components": [ 317 | { 318 | "__id__": 9 319 | } 320 | ], 321 | "_prefab": null, 322 | "_id": "31f1bH7V69Ajr1iXhluMpTB", 323 | "_opacity": 255, 324 | "_color": { 325 | "__type__": "cc.Color", 326 | "r": 255, 327 | "g": 255, 328 | "b": 255, 329 | "a": 255 330 | }, 331 | "_cascadeOpacityEnabled": true, 332 | "_anchorPoint": { 333 | "__type__": "cc.Vec2", 334 | "x": 0.5, 335 | "y": 0.5 336 | }, 337 | "_contentSize": { 338 | "__type__": "cc.Size", 339 | "width": 146.81, 340 | "height": 60 341 | }, 342 | "_rotationX": 0, 343 | "_rotationY": 0, 344 | "_scaleX": 1, 345 | "_scaleY": 1, 346 | "_position": { 347 | "__type__": "cc.Vec2", 348 | "x": 0, 349 | "y": -180 350 | }, 351 | "_skewX": 0, 352 | "_skewY": 0, 353 | "_localZOrder": 0, 354 | "_globalZOrder": 0, 355 | "_opacityModifyRGB": false, 356 | "groupIndex": 0 357 | }, 358 | { 359 | "__type__": "cc.Label", 360 | "_name": "", 361 | "_objFlags": 0, 362 | "node": { 363 | "__id__": 8 364 | }, 365 | "_enabled": true, 366 | "_useOriginalSize": false, 367 | "_actualFontSize": 60, 368 | "_fontSize": 60, 369 | "_lineHeight": 60, 370 | "_enableWrapText": true, 371 | "_N$file": null, 372 | "_isSystemFontUsed": true, 373 | "_spacingX": 0, 374 | "_N$string": "Label", 375 | "_N$horizontalAlign": 1, 376 | "_N$verticalAlign": 1, 377 | "_N$fontFamily": "Arial", 378 | "_N$overflow": 0 379 | }, 380 | { 381 | "__type__": "cc.Node", 382 | "_name": "title", 383 | "_objFlags": 0, 384 | "_parent": { 385 | "__id__": 2 386 | }, 387 | "_children": [], 388 | "_tag": -1, 389 | "_active": true, 390 | "_components": [ 391 | { 392 | "__id__": 11 393 | } 394 | ], 395 | "_prefab": null, 396 | "_id": "e9952+UKsdKCbBqD325P6S6", 397 | "_opacity": 255, 398 | "_color": { 399 | "__type__": "cc.Color", 400 | "r": 255, 401 | "g": 255, 402 | "b": 255, 403 | "a": 255 404 | }, 405 | "_cascadeOpacityEnabled": true, 406 | "_anchorPoint": { 407 | "__type__": "cc.Vec2", 408 | "x": 0.5, 409 | "y": 0.5 410 | }, 411 | "_contentSize": { 412 | "__type__": "cc.Size", 413 | "width": 280, 414 | "height": 40 415 | }, 416 | "_rotationX": 0, 417 | "_rotationY": 0, 418 | "_scaleX": 1, 419 | "_scaleY": 1, 420 | "_position": { 421 | "__type__": "cc.Vec2", 422 | "x": -21, 423 | "y": 232 424 | }, 425 | "_skewX": 0, 426 | "_skewY": 0, 427 | "_localZOrder": 0, 428 | "_globalZOrder": 0, 429 | "_opacityModifyRGB": false, 430 | "groupIndex": 0 431 | }, 432 | { 433 | "__type__": "cc.Label", 434 | "_name": "", 435 | "_objFlags": 0, 436 | "node": { 437 | "__id__": 10 438 | }, 439 | "_enabled": true, 440 | "_useOriginalSize": false, 441 | "_actualFontSize": 40, 442 | "_fontSize": 40, 443 | "_lineHeight": 40, 444 | "_enableWrapText": true, 445 | "_N$file": null, 446 | "_isSystemFontUsed": true, 447 | "_spacingX": 0, 448 | "_N$string": "这是一个子游戏", 449 | "_N$horizontalAlign": 1, 450 | "_N$verticalAlign": 1, 451 | "_N$fontFamily": "Arial", 452 | "_N$overflow": 0 453 | }, 454 | { 455 | "__type__": "cc.Node", 456 | "_name": "btn_bak", 457 | "_objFlags": 0, 458 | "_parent": { 459 | "__id__": 2 460 | }, 461 | "_children": [ 462 | { 463 | "__id__": 13 464 | } 465 | ], 466 | "_tag": -1, 467 | "_active": true, 468 | "_components": [ 469 | { 470 | "__id__": 15 471 | }, 472 | { 473 | "__id__": 16 474 | } 475 | ], 476 | "_prefab": null, 477 | "_id": "ffa6354/NNA9L4Wziw2yhYL", 478 | "_opacity": 255, 479 | "_color": { 480 | "__type__": "cc.Color", 481 | "r": 255, 482 | "g": 255, 483 | "b": 255, 484 | "a": 255 485 | }, 486 | "_cascadeOpacityEnabled": true, 487 | "_anchorPoint": { 488 | "__type__": "cc.Vec2", 489 | "x": 0.5, 490 | "y": 0.5 491 | }, 492 | "_contentSize": { 493 | "__type__": "cc.Size", 494 | "width": 100, 495 | "height": 40 496 | }, 497 | "_rotationX": 0, 498 | "_rotationY": 0, 499 | "_scaleX": 1, 500 | "_scaleY": 1, 501 | "_position": { 502 | "__type__": "cc.Vec2", 503 | "x": 341, 504 | "y": -174 505 | }, 506 | "_skewX": 0, 507 | "_skewY": 0, 508 | "_localZOrder": 0, 509 | "_globalZOrder": 0, 510 | "_opacityModifyRGB": false, 511 | "groupIndex": 0 512 | }, 513 | { 514 | "__type__": "cc.Node", 515 | "_name": "Label", 516 | "_objFlags": 0, 517 | "_parent": { 518 | "__id__": 12 519 | }, 520 | "_children": [], 521 | "_tag": -1, 522 | "_active": true, 523 | "_components": [ 524 | { 525 | "__id__": 14 526 | } 527 | ], 528 | "_prefab": null, 529 | "_id": "a0cefswYHRCEpc33yHUK2z/", 530 | "_opacity": 255, 531 | "_color": { 532 | "__type__": "cc.Color", 533 | "r": 0, 534 | "g": 0, 535 | "b": 0, 536 | "a": 255 537 | }, 538 | "_cascadeOpacityEnabled": true, 539 | "_anchorPoint": { 540 | "__type__": "cc.Vec2", 541 | "x": 0.5, 542 | "y": 0.5 543 | }, 544 | "_contentSize": { 545 | "__type__": "cc.Size", 546 | "width": 100, 547 | "height": 40 548 | }, 549 | "_rotationX": 0, 550 | "_rotationY": 0, 551 | "_scaleX": 1, 552 | "_scaleY": 1, 553 | "_position": { 554 | "__type__": "cc.Vec2", 555 | "x": 0, 556 | "y": 0 557 | }, 558 | "_skewX": 0, 559 | "_skewY": 0, 560 | "_localZOrder": 0, 561 | "_globalZOrder": 0, 562 | "_opacityModifyRGB": false, 563 | "groupIndex": 0 564 | }, 565 | { 566 | "__type__": "cc.Label", 567 | "_name": "", 568 | "_objFlags": 0, 569 | "node": { 570 | "__id__": 13 571 | }, 572 | "_enabled": true, 573 | "_useOriginalSize": false, 574 | "_actualFontSize": 20, 575 | "_fontSize": 20, 576 | "_lineHeight": 40, 577 | "_enableWrapText": false, 578 | "_N$file": null, 579 | "_isSystemFontUsed": true, 580 | "_spacingX": 0, 581 | "_N$string": "返回大厅", 582 | "_N$horizontalAlign": 1, 583 | "_N$verticalAlign": 1, 584 | "_N$fontFamily": "Arial", 585 | "_N$overflow": 1 586 | }, 587 | { 588 | "__type__": "cc.Sprite", 589 | "_name": "", 590 | "_objFlags": 0, 591 | "node": { 592 | "__id__": 12 593 | }, 594 | "_enabled": true, 595 | "_spriteFrame": { 596 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 597 | }, 598 | "_type": 1, 599 | "_sizeMode": 0, 600 | "_fillType": 0, 601 | "_fillCenter": { 602 | "__type__": "cc.Vec2", 603 | "x": 0, 604 | "y": 0 605 | }, 606 | "_fillStart": 0, 607 | "_fillRange": 0, 608 | "_isTrimmedMode": true, 609 | "_srcBlendFactor": 770, 610 | "_dstBlendFactor": 771, 611 | "_atlas": null 612 | }, 613 | { 614 | "__type__": "cc.Button", 615 | "_name": "", 616 | "_objFlags": 0, 617 | "node": { 618 | "__id__": 12 619 | }, 620 | "_enabled": true, 621 | "transition": 2, 622 | "pressedColor": { 623 | "__type__": "cc.Color", 624 | "r": 255, 625 | "g": 255, 626 | "b": 255, 627 | "a": 255 628 | }, 629 | "hoverColor": { 630 | "__type__": "cc.Color", 631 | "r": 255, 632 | "g": 255, 633 | "b": 255, 634 | "a": 255 635 | }, 636 | "duration": 0.1, 637 | "zoomScale": 1.2, 638 | "pressedSprite": { 639 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 640 | }, 641 | "hoverSprite": { 642 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 643 | }, 644 | "clickEvents": [ 645 | { 646 | "__id__": 17 647 | } 648 | ], 649 | "_N$interactable": true, 650 | "_N$enableAutoGrayEffect": false, 651 | "_N$normalColor": { 652 | "__type__": "cc.Color", 653 | "r": 255, 654 | "g": 255, 655 | "b": 255, 656 | "a": 255 657 | }, 658 | "_N$disabledColor": { 659 | "__type__": "cc.Color", 660 | "r": 255, 661 | "g": 255, 662 | "b": 255, 663 | "a": 255 664 | }, 665 | "_N$normalSprite": { 666 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 667 | }, 668 | "_N$disabledSprite": { 669 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 670 | }, 671 | "_N$target": { 672 | "__id__": 12 673 | } 674 | }, 675 | { 676 | "__type__": "cc.ClickEvent", 677 | "target": { 678 | "__id__": 2 679 | }, 680 | "component": "HelloWorld", 681 | "handler": "on_back", 682 | "customEventData": "" 683 | }, 684 | { 685 | "__type__": "cc.Canvas", 686 | "_name": "", 687 | "_objFlags": 0, 688 | "node": { 689 | "__id__": 2 690 | }, 691 | "_enabled": true, 692 | "_designResolution": { 693 | "__type__": "cc.Size", 694 | "width": 960, 695 | "height": 640 696 | }, 697 | "_fitWidth": false, 698 | "_fitHeight": true 699 | }, 700 | { 701 | "__type__": "280c3rsZJJKnZ9RqbALVwtK", 702 | "_name": "", 703 | "_objFlags": 0, 704 | "node": { 705 | "__id__": 2 706 | }, 707 | "_enabled": true, 708 | "label": { 709 | "__id__": 9 710 | }, 711 | "text": "Hello, World!" 712 | } 713 | ] -------------------------------------------------------------------------------- /subgame/assets/Scene/helloworld.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "2d2f792f-a40c-49bb-a189-ed176a246e49", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /subgame/assets/Script.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "4734c20c-0db8-4eb2-92ea-e692f4d70934", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /subgame/assets/Script/HelloWorld.js: -------------------------------------------------------------------------------- 1 | cc.Class({ 2 | extends: cc.Component, 3 | 4 | properties: { 5 | label: { 6 | default: null, 7 | type: cc.Label 8 | }, 9 | // defaults, set visually when attaching this script to the Canvas 10 | text: 'Hello_World!' 11 | }, 12 | 13 | // use this for initialization 14 | onLoad: function() { 15 | this.label.string = this.text; 16 | }, 17 | 18 | // called every frame 19 | update: function(dt) { 20 | 21 | }, 22 | on_back: function() { 23 | console.log("btn_back clicked!!!!"); 24 | 25 | require(cc.INGAME + "/src/dating.js"); 26 | }, 27 | }); -------------------------------------------------------------------------------- /subgame/assets/Script/HelloWorld.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "280c3aec-6492-4a9d-9f51-a9b00b570b4a", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /subgame/assets/Texture.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "7b81d4e8-ec84-4716-968d-500ac1d78a54", 4 | "isGroup": false, 5 | "subMetas": {} 6 | } -------------------------------------------------------------------------------- /subgame/assets/Texture/HelloWorld.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Leo501/HallAndGames/6cf9c661ddb9f697d0092fad663a077a26a73427/subgame/assets/Texture/HelloWorld.png -------------------------------------------------------------------------------- /subgame/assets/Texture/HelloWorld.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "HelloWorld": { 9 | "ver": "1.0.3", 10 | "uuid": "31bc895a-c003-4566-a9f3-2e54ae1c17dc", 11 | "rawTextureUuid": "6aa0aa6a-ebee-4155-a088-a687a6aadec4", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 195, 20 | "height": 270, 21 | "rawWidth": 195, 22 | "rawHeight": 270, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /subgame/assets/Texture/singleColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Leo501/HallAndGames/6cf9c661ddb9f697d0092fad663a077a26a73427/subgame/assets/Texture/singleColor.png -------------------------------------------------------------------------------- /subgame/assets/Texture/singleColor.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "subMetas": { 8 | "singleColor": { 9 | "ver": "1.0.3", 10 | "uuid": "410fb916-8721-4663-bab8-34397391ace7", 11 | "rawTextureUuid": "a8027877-d8d6-4645-97a0-52d4a0123dba", 12 | "trimType": "auto", 13 | "trimThreshold": 1, 14 | "rotated": false, 15 | "offsetX": 0, 16 | "offsetY": 0, 17 | "trimX": 0, 18 | "trimY": 0, 19 | "width": 2, 20 | "height": 2, 21 | "rawWidth": 2, 22 | "rawHeight": 2, 23 | "borderTop": 0, 24 | "borderBottom": 0, 25 | "borderLeft": 0, 26 | "borderRight": 0, 27 | "subMetas": {} 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /subgame/dating.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | cc.loader.releaseAll(); 3 | cc.sys.garbageCollect(); 4 | 'use strict'; 5 | var _CCSettings = null ; 6 | var settings = null; 7 | 8 | 9 | cc.INGAME = ""; 10 | require(cc.INGAME+'src/settings.js'); 11 | 12 | settings = window._CCSettings; 13 | window._CCSettings = undefined; 14 | 15 | settings["scenes"].push({ 16 | "url": "db://assets/hall.fire", 17 | "uuid": "7brp21UJhJsLMGvPc8eZqF" 18 | }); 19 | 20 | var uuids = settings.uuids; 21 | var rawAssets = settings.rawAssets; 22 | var assetTypes = settings.assetTypes; 23 | var realRawAssets = settings.rawAssets = {}; 24 | for (var mount in rawAssets) { 25 | var entries = rawAssets[mount]; 26 | var realEntries = realRawAssets[mount] = {}; 27 | for (var id in entries) { 28 | var entry = entries[id]; 29 | var type = entry[1]; 30 | // retrieve minified raw asset 31 | if (typeof type === 'number') { 32 | entry[1] = assetTypes[type]; 33 | } 34 | // retrieve uuid 35 | realEntries[uuids[id] || id] = entry; 36 | } 37 | } 38 | 39 | var scenes = settings.scenes; 40 | for (var i = 0; i < scenes.length; ++i) { 41 | var scene = scenes[i]; 42 | if (typeof scene.uuid === 'number') { 43 | scene.uuid = uuids[scene.uuid]; 44 | } 45 | } 46 | 47 | var packedAssets = settings.packedAssets; 48 | for (var packId in packedAssets) { 49 | var packedIds = packedAssets[packId]; 50 | for (var j = 0; j < packedIds.length; ++j) { 51 | if (typeof packedIds[j] === 'number') { 52 | packedIds[j] = uuids[packedIds[j]]; 53 | } 54 | } 55 | } 56 | 57 | 58 | var onStart = function () { 59 | cc.view.resizeWithBrowserSize(true); 60 | // UC browser on many android devices have performance issue with retina display 61 | if (cc.sys.os !== cc.sys.OS_ANDROID || cc.sys.browserType !== cc.sys.BROWSER_TYPE_UC) { 62 | cc.view.enableRetina(true); 63 | } 64 | 65 | 66 | 67 | if (cc.sys.isMobile) { 68 | if (settings.orientation === 'landscape') { 69 | cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE); 70 | } 71 | else if (settings.orientation === 'portrait') { 72 | cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT); 73 | } 74 | // qq, wechat, baidu 75 | cc.view.enableAutoFullScreen( 76 | cc.sys.browserType !== cc.sys.BROWSER_TYPE_BAIDU && 77 | cc.sys.browserType !== cc.sys.BROWSER_TYPE_WECHAT && 78 | cc.sys.browserType !== cc.sys.BROWSER_TYPE_MOBILE_QQ 79 | ); 80 | } 81 | 82 | // Limit downloading max concurrent task to 2, 83 | // more tasks simultaneously may cause performance draw back on some android system / brwosers. 84 | // You can adjust the number based on your own test result, you have to set it before any loading process to take effect. 85 | if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) { 86 | cc.macro.DOWNLOAD_MAX_CONCURRENT = 2; 87 | } 88 | 89 | 90 | // init assets 91 | cc.AssetLibrary.init({ 92 | libraryPath: cc.INGAME +'res/import', 93 | rawAssetsBase: cc.INGAME +'res/raw-', 94 | rawAssets: settings.rawAssets, 95 | packedAssets: settings.packedAssets, 96 | md5AssetsMap: settings.md5AssetsMap 97 | }); 98 | 99 | 100 | var launchScene = "db://assets/hall.fire"; 101 | 102 | 103 | // load scene 104 | if (cc.runtime) { 105 | cc.director.setRuntimeLaunchScene(launchScene); 106 | } 107 | 108 | 109 | cc.director.loadScene(launchScene, null, 110 | function () { 111 | if (cc.sys.isBrowser) { 112 | // show canvas 113 | canvas.style.visibility = ''; 114 | var div = document.getElementById('GameDiv'); 115 | if (div) { 116 | div.style.backgroundImage = ''; 117 | } 118 | } 119 | cc.loader.onProgress = null; 120 | 121 | // play game 122 | // cc.game.resume(); 123 | 124 | console.log('Success to load scene: ' + launchScene); 125 | } 126 | ); 127 | }; 128 | 129 | // jsList 130 | var jsList = settings.jsList; 131 | var bundledScript = settings.debug ? cc.INGAME+'src/project.dev.js' : cc.INGAME+'src/project.js'; 132 | if (jsList) { 133 | jsList = jsList.map(function (x) { return cc.INGAME+'src/' + x; }); 134 | jsList.push(bundledScript); 135 | } 136 | else { 137 | jsList = [bundledScript]; 138 | } 139 | 140 | // anysdk scripts 141 | if (cc.sys.isNative && cc.sys.isMobile) { 142 | // jsList = jsList.concat(['src/anysdk/jsb_anysdk.js', 'src/anysdk/jsb_anysdk_constants.js']); 143 | } 144 | 145 | 146 | var option = { 147 | //width: width, 148 | //height: height, 149 | id: 'GameCanvas', 150 | scenes: settings.scenes, 151 | debugMode: settings.debug ? cc.DebugMode.INFO : cc.DebugMode.ERROR, 152 | showFPS: settings.debug, 153 | frameRate: 60, 154 | jsList: jsList, 155 | groupList: settings.groupList, 156 | collisionMatrix: settings.collisionMatrix, 157 | renderMode: 0 158 | }; 159 | 160 | cc.game.run(option, onStart); 161 | 162 | cc.sys.garbageCollect(); 163 | 164 | 165 | })(); 166 | -------------------------------------------------------------------------------- /subgame/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /subgame/main.js: -------------------------------------------------------------------------------- 1 | 2 | console.log("wo过来"); 3 | (function () { 4 | cc.loader.releaseAll(); 5 | cc.sys.garbageCollect(); 6 | 'use strict'; 7 | var _CCSettings = null ; 8 | 9 | var settings = null; 10 | 11 | cc.INGAME = (jsb.fileUtils ? jsb.fileUtils.getWritablePath() : '/')+"ALLGame/subgame/"; 12 | 13 | 14 | 15 | require(cc.INGAME+'src/settings.js'); 16 | settings = window._CCSettings; 17 | 18 | settings["scenes"].push({ 19 | "url": "db://assets/hall.fire", 20 | "uuid": "7brp21UJhJsLMGvPc8eZqF" 21 | }); 22 | 23 | 24 | 25 | if(!cc.subgame || cc.QIANGXING == 1){ 26 | cc.subgame = 1; 27 | require(cc.INGAME+'src/project.js'); 28 | } 29 | 30 | 31 | 32 | 33 | window._CCSettings = undefined; 34 | 35 | 36 | 37 | 38 | var uuids = settings.uuids; 39 | 40 | 41 | 42 | var rawAssets = settings.rawAssets; 43 | var assetTypes = settings.assetTypes; 44 | var realRawAssets = settings.rawAssets = {}; 45 | for (var mount in rawAssets) { 46 | var entries = rawAssets[mount]; 47 | var realEntries = realRawAssets[mount] = {}; 48 | for (var id in entries) { 49 | var entry = entries[id]; 50 | var type = entry[1]; 51 | // retrieve minified raw asset 52 | if (typeof type === 'number') { 53 | entry[1] = assetTypes[type]; 54 | } 55 | // retrieve uuid 56 | realEntries[uuids[id] || id] = entry; 57 | } 58 | } 59 | 60 | var scenes = settings.scenes; 61 | for (var i = 0; i < scenes.length; ++i) { 62 | var scene = scenes[i]; 63 | if (typeof scene.uuid === 'number') { 64 | scene.uuid = uuids[scene.uuid]; 65 | } 66 | } 67 | 68 | var packedAssets = settings.packedAssets; 69 | for (var packId in packedAssets) { 70 | var packedIds = packedAssets[packId]; 71 | for (var j = 0; j < packedIds.length; ++j) { 72 | if (typeof packedIds[j] === 'number') { 73 | packedIds[j] = uuids[packedIds[j]]; 74 | } 75 | } 76 | } 77 | 78 | 79 | var onStart = function () { 80 | cc.view.resizeWithBrowserSize(true); 81 | // UC browser on many android devices have performance issue with retina display 82 | if (cc.sys.os !== cc.sys.OS_ANDROID || cc.sys.browserType !== cc.sys.BROWSER_TYPE_UC) { 83 | cc.view.enableRetina(true); 84 | } 85 | //cc.view.setDesignResolutionSize(settings.designWidth, settings.designHeight, cc.ResolutionPolicy.SHOW_ALL); 86 | 87 | 88 | 89 | if (cc.sys.isMobile) { 90 | if (settings.orientation === 'landscape') { 91 | cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE); 92 | } 93 | else if (settings.orientation === 'portrait') { 94 | cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT); 95 | } 96 | // qq, wechat, baidu 97 | cc.view.enableAutoFullScreen( 98 | cc.sys.browserType !== cc.sys.BROWSER_TYPE_BAIDU && 99 | cc.sys.browserType !== cc.sys.BROWSER_TYPE_WECHAT && 100 | cc.sys.browserType !== cc.sys.BROWSER_TYPE_MOBILE_QQ 101 | ); 102 | } 103 | 104 | // Limit downloading max concurrent task to 2, 105 | // more tasks simultaneously may cause performance draw back on some android system / brwosers. 106 | // You can adjust the number based on your own test result, you have to set it before any loading process to take effect. 107 | if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) { 108 | cc.macro.DOWNLOAD_MAX_CONCURRENT = 2; 109 | } 110 | 111 | 112 | // init assets 113 | cc.AssetLibrary.init({ 114 | libraryPath: cc.INGAME +'res/import', 115 | rawAssetsBase: cc.INGAME +'res/raw-', 116 | rawAssets: settings.rawAssets, 117 | packedAssets: settings.packedAssets, 118 | md5AssetsMap: settings.md5AssetsMap 119 | }); 120 | 121 | var launchScene = settings.launchScene; 122 | 123 | // load scene 124 | if (cc.runtime) { 125 | cc.director.setRuntimeLaunchScene(launchScene); 126 | } 127 | cc.director.loadScene(launchScene, null, 128 | function () { 129 | if (cc.sys.isBrowser) { 130 | // show canvas 131 | canvas.style.visibility = ''; 132 | var div = document.getElementById('GameDiv'); 133 | if (div) { 134 | div.style.backgroundImage = ''; 135 | } 136 | } 137 | cc.loader.onProgress = null; 138 | 139 | // play game 140 | // cc.game.resume(); 141 | 142 | console.log('Success to load scene: ' + launchScene); 143 | } 144 | ); 145 | }; 146 | 147 | // jsList 148 | var jsList = settings.jsList; 149 | var bundledScript = settings.debug ? cc.INGAME+'src/project.dev.js' : cc.INGAME+'src/project.js'; 150 | if (jsList) { 151 | jsList = jsList.map(function (x) { return cc.INGAME+'src/' + x; }); 152 | jsList.push(bundledScript); 153 | } 154 | else { 155 | jsList = [bundledScript]; 156 | } 157 | 158 | // anysdk scripts 159 | if (cc.sys.isNative && cc.sys.isMobile) { 160 | // jsList = jsList.concat(['src/anysdk/jsb_anysdk.js', 'src/anysdk/jsb_anysdk_constants.js']); 161 | } 162 | 163 | 164 | var option = { 165 | //width: width, 166 | //height: height, 167 | id: 'GameCanvas', 168 | scenes: settings.scenes, 169 | debugMode: settings.debug ? cc.DebugMode.INFO : cc.DebugMode.ERROR, 170 | showFPS: settings.debug, 171 | frameRate: 60, 172 | jsList: jsList, 173 | groupList: settings.groupList, 174 | collisionMatrix: settings.collisionMatrix, 175 | renderMode: 0 176 | }; 177 | 178 | cc.game.run(option, onStart); 179 | cc.sys.garbageCollect(); 180 | 181 | 182 | 183 | })(); 184 | -------------------------------------------------------------------------------- /subgame/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos2d-html5", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /subgame/settings/builder.json: -------------------------------------------------------------------------------- 1 | { 2 | "appKey": "", 3 | "appSecret": "", 4 | "encryptJs": false, 5 | "excludeScenes": [], 6 | "fb-instant-games": {}, 7 | "includeAnySDK": false, 8 | "includeSDKBox": false, 9 | "inlineSpriteFrames": true, 10 | "inlineSpriteFrames_native": true, 11 | "jailbreakPlatform": false, 12 | "md5Cache": false, 13 | "mergeStartScene": false, 14 | "oauthLoginServer": "", 15 | "optimizeHotUpdate": false, 16 | "orientation": { 17 | "landscapeLeft": true, 18 | "landscapeRight": true, 19 | "portrait": false, 20 | "upsideDown": false 21 | }, 22 | "packageName": "org.cocos2d.helloworld", 23 | "privateKey": "", 24 | "qqplay": { 25 | "REMOTE_SERVER_ROOT": "", 26 | "orientation": "portrait" 27 | }, 28 | "renderMode": "0", 29 | "startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49", 30 | "title": "hello_world", 31 | "webOrientation": "auto", 32 | "wechatgame": { 33 | "REMOTE_SERVER_ROOT": "", 34 | "appid": "wx6ac3f5090a6b99c5", 35 | "isSubdomain": false, 36 | "orientation": "portrait", 37 | "subContext": "" 38 | }, 39 | "xxteaKey": "d7eed64e-50f7-43", 40 | "zipCompressJs": true 41 | } -------------------------------------------------------------------------------- /subgame/settings/builder.panel.json: -------------------------------------------------------------------------------- 1 | { 2 | "excludeScenes": [], 3 | "packageName": "org.cocos2d.helloworld", 4 | "platform": "web-mobile", 5 | "startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49", 6 | "title": "HelloWorld" 7 | } -------------------------------------------------------------------------------- /subgame/settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "collision-matrix": [ 3 | [ 4 | true 5 | ] 6 | ], 7 | "excluded-modules": [], 8 | "group-list": [ 9 | "default" 10 | ], 11 | "start-scene": "current", 12 | "design-resolution-width": 960, 13 | "design-resolution-height": 640, 14 | "fit-width": false, 15 | "fit-height": true, 16 | "use-project-simulator-setting": false, 17 | "simulator-orientation": false, 18 | "use-customize-simulator": false, 19 | "simulator-resolution": { 20 | "width": 960, 21 | "height": 640 22 | }, 23 | "cocos-analytics": { 24 | "enable": false, 25 | "appID": "13798", 26 | "appSecret": "959b3ac0037d0f3c2fdce94f8421a9b2" 27 | } 28 | } -------------------------------------------------------------------------------- /subgame/template-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Leo501/HallAndGames/6cf9c661ddb9f697d0092fad663a077a26a73427/subgame/template-banner.png -------------------------------------------------------------------------------- /subgame/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TEMPLATES.helloworld.name", 3 | "desc": "TEMPLATES.helloworld.desc", 4 | "banner": "template-banner.png" 5 | } -------------------------------------------------------------------------------- /subgame/test.txt: -------------------------------------------------------------------------------- 1 | 1550286841232.01 -------------------------------------------------------------------------------- /subgame/version_generator.bat: -------------------------------------------------------------------------------- 1 | node version_generator.js -v 1.0.2 -u http://192.168.0.116/down/remote-assets/subgame/ -s ../build/jsb-link/ -d ../assets/ 2 | pause 3 | -------------------------------------------------------------------------------- /subgame/version_generator.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var crypto = require('crypto'); 4 | 5 | var games = 'subgame'; 6 | var CUHTTP = 'http://192.168.0.133/down/remote-assets/' + games + '/'; 7 | 8 | 9 | function fsExistsSync(path) { 10 | try { 11 | fs.accessSync(path, fs.F_OK); 12 | } catch (e) { 13 | return false; 14 | } 15 | return true; 16 | } 17 | 18 | if (fsExistsSync('./test.txt')) { 19 | var shujuda = (parseFloat(fs.readFileSync('./test.txt', 'utf8'))); 20 | shujuda += 0.01; 21 | } else { 22 | shujuda = Date.now(); 23 | } 24 | 25 | shujuda = shujuda.toFixed(2); 26 | 27 | if (isNaN(shujuda)) { 28 | 29 | shujuda = Date.now(); 30 | } 31 | 32 | fs.writeFile('./test.txt', shujuda, function (err) { 33 | if (err) throw err; 34 | //console.log('has finished'); 35 | }); 36 | 37 | 38 | 39 | 40 | if (process.argv && process.argv['2']) { 41 | console.log("Game " + process.argv['2']); 42 | games = process.argv['2']; 43 | } 44 | 45 | console.log("Ver: " + shujuda); 46 | 47 | var manifest = { 48 | packageUrl: CUHTTP, 49 | remoteManifestUrl: CUHTTP + 'peision.manifest', 50 | remoteVersionUrl: CUHTTP + 'version.manifest', 51 | version: shujuda, 52 | assets: {}, 53 | searchPaths: [] 54 | }; 55 | 56 | 57 | var dest = './build/jsb-link'; 58 | var src = './build/jsb-link'; 59 | var LUJIN = process.cwd() + "/" + src; 60 | 61 | 62 | 63 | function readDir(dir, obj) { 64 | var stat = fs.statSync(dir); 65 | if (!stat.isDirectory()) { 66 | return; 67 | } 68 | var subpaths = fs.readdirSync(dir), 69 | subpath, size, md5, compressed, relative; 70 | 71 | for (var i = 0; i < subpaths.length; ++i) { 72 | if (subpaths[i][0] === '.') { 73 | continue; 74 | } 75 | subpath = path.join(dir, subpaths[i]); 76 | console.log('subpaths=', subpath); 77 | stat = fs.statSync(subpath); 78 | if (stat.isDirectory()) { 79 | readDir(subpath, obj); 80 | } else if (stat.isFile()) { 81 | // Size in Bytes 82 | size = stat['size']; 83 | md5 = crypto.createHash('md5').update(fs.readFileSync(subpath)).digest('hex'); 84 | compressed = path.extname(subpath).toLowerCase() === '.zip'; 85 | 86 | relative = path.relative(src, subpath); 87 | relative = encodeURI(relative); 88 | relative = relative.replace(/%5C/g, "/"); 89 | obj[relative] = { 90 | 'size': size, 91 | 'md5': md5 92 | }; 93 | if (compressed) { 94 | obj[relative].compressed = true; 95 | } 96 | } 97 | } 98 | } 99 | 100 | var mkdirSync = function (path) { 101 | try { 102 | fs.mkdirSync(path); 103 | } catch (e) { 104 | if (e.code != 'EEXIST') throw e; 105 | } 106 | }; 107 | 108 | // Iterate res and src folder 109 | readDir(path.join(src, 'src'), manifest.assets); 110 | readDir(path.join(src, 'res'), manifest.assets); 111 | 112 | var destManifest = path.join(dest, 'peision.manifest'); 113 | var destVersion = path.join(dest, 'version.manifest'); 114 | 115 | mkdirSync(dest); 116 | 117 | fs.writeFile(destManifest, JSON.stringify(manifest), (err) => { 118 | if (err) throw err; 119 | console.log('Manifest successfully generated'); 120 | }); 121 | 122 | delete manifest.assets; 123 | delete manifest.searchPaths; 124 | fs.writeFile(destVersion, JSON.stringify(manifest), (err) => { 125 | if (err) throw err; 126 | console.log('Version successfully generated'); 127 | }); 128 | 129 | dest 130 | 131 | /* 132 | var exec = require('child_process').exec; 133 | var cmdStr = 'zip -q -m -o a.zip '+LUJIN+'/res/'; 134 | exec(cmdStr, function(err,stdout,stderr){ 135 | if(err) { 136 | console.log('get weather api error:'+stderr); 137 | } else { 138 | console.log('ok'); 139 | } 140 | }); 141 | */ --------------------------------------------------------------------------------