Compare commits
503 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bf14b59a28 | |||
| 0a0f64510f | |||
| 9445c735c3 | |||
| 7339e7ecec | |||
| 79f7c89e23 | |||
| e724e5a1ba | |||
| fdaa94a61d | |||
| 6af0074c36 | |||
| 97a69fed09 | |||
| 959879440d | |||
| fd1bbb0e00 | |||
| 072e68cf43 | |||
| 610232e6b0 | |||
| 69c46f32eb | |||
| 06b3f92007 | |||
| c631290049 | |||
| f41c1a3ca3 | |||
| bd6ba84087 | |||
| 1512409eb3 | |||
| bcb5feeb1c | |||
| da8b7cf601 | |||
| 316527c459 | |||
| da70818b22 | |||
| 5ea3b72b2b | |||
| 632864b361 | |||
| 952247def0 | |||
| 51debede52 | |||
| ce7b731bcf | |||
| 86e2dc8fdb | |||
| 78047134c2 | |||
| 125a1686ab | |||
| d542ac48b8 | |||
| 1ac0227c90 | |||
| a5e70bcd99 | |||
| 38763de7f6 | |||
| db73b077c5 | |||
| 0969d09da1 | |||
| a07108a431 | |||
| 6693b56ab8 | |||
| a7349bd360 | |||
| e92c0040b5 | |||
| f448fa48c4 | |||
| aa33cad4fa | |||
| d0cb7d5359 | |||
| 90153b98fe | |||
| 8c4e8d523e | |||
| 90ad4b3ec4 | |||
| 62bc6b547e | |||
| be11060674 | |||
| d62bf9f7f9 | |||
| 61fcd52c65 | |||
| 2947ddeb64 | |||
| d9b752c180 | |||
| b82891caee | |||
| 05f04ef37e | |||
| 66dc9780b9 | |||
| d48b22c656 | |||
| 727b1864eb | |||
| de3bfd7551 | |||
| dedb91379f | |||
| 1dfcd008aa | |||
| cf2dc91af6 | |||
| a66f80a766 | |||
| f4e49c316e | |||
| d1cd72bbb2 | |||
| 6178851def | |||
| 945f772c30 | |||
| b546c9c712 | |||
| 413ce93b31 | |||
| cffe32911d | |||
| 4f651eb42e | |||
| 6da1585b6b | |||
| b988e81a1b | |||
| 1a1c1087d2 | |||
| 1a1549230f | |||
| 64ea53eba1 | |||
| 5e052a7e7d | |||
| cf9ea495d0 | |||
| 9603c6423b | |||
| 457eef585e | |||
| 1ade449c4d | |||
| aa9d73a810 | |||
| cc266a7ba9 | |||
| d8ea324018 | |||
| 60566e8d78 | |||
| 306d2994dc | |||
| e6a8791fc3 | |||
| 6cbbc06998 | |||
| 0b4244fd8e | |||
| 367ddfbf8a | |||
| 168e028098 | |||
| 042ded37d2 | |||
| 4137eb2bce | |||
| 20a3f03e12 | |||
| 7792710694 | |||
| dbddbbdfb8 | |||
| 4869f5741e | |||
| bda547dd2e | |||
| ef80b03a44 | |||
| 6e511ae949 | |||
| 94541d0abb | |||
| 586a0e5d14 | |||
| 814842dbaf | |||
| 70a993573f | |||
| 21659cbb13 | |||
| a44251cc55 | |||
| 69616bbddc | |||
| 0a1d7ac083 | |||
| 364bc4cdab | |||
| 2504eb24e1 | |||
| bdbef0bd0d | |||
| e4e38ee4e6 | |||
| 021e892e33 | |||
| c27d5022fd | |||
| 6730a5d625 | |||
| 32092f992d | |||
| a5f0c8f6b5 | |||
| 85cd93e51a | |||
| 0b7e623748 | |||
| 62f250b43c | |||
| 25136349ff | |||
| baeb047e27 | |||
| 56dd18b983 | |||
| 86cb70a94f | |||
| 9f76d37a82 | |||
| a026ed9428 | |||
| c178e2fbcc | |||
| b88bb1dc87 | |||
| 3069e28224 | |||
| d69b3af99b | |||
| 7398b7c6d0 | |||
| 5d57904d22 | |||
| 7daf352a25 | |||
| 6a49f6a534 | |||
| 5bce08683a | |||
| edc60fc3d8 | |||
| 1361fd8a90 | |||
| d539bb3dd9 | |||
| 3b9ae4f384 | |||
| 2783448de5 | |||
| 6e21ff08d5 | |||
| e56278e4a6 | |||
| fc9bf816dd | |||
| 854fd7df3a | |||
| 87dd564a12 | |||
| 2d389308ea | |||
| ea8523be35 | |||
| 4479f0fab0 | |||
| 7a000318a6 | |||
| 9a08ae74b6 | |||
| f3d2950df3 | |||
| 8cfba4a166 | |||
| 51e6bba2a7 | |||
| ccbfa78070 | |||
| 69655f1936 | |||
| 6ea366cfed | |||
| b7d17fb16d | |||
| f3dc8c6344 | |||
| 69ec545854 | |||
| 65386ff731 | |||
| 01fa33e122 | |||
| 0411aa9aef | |||
| 4a5c890121 | |||
| 4c11fdc176 | |||
| d99e7a45ea | |||
| 52528ff1b7 | |||
| 4a9317f3f4 | |||
| 9450dd5869 | |||
| d5471e4828 | |||
| 2f71785add | |||
| 608f5030b2 | |||
| dd8f3714ed | |||
| abec2b3648 | |||
| ea06a9f07d | |||
| 9f54759cc5 | |||
| 55dd5f9ed0 | |||
| 05455421fb | |||
| af61067f08 | |||
| 19cda88248 | |||
| 0edb2738a1 | |||
| e1bc364525 | |||
| 2925ee380d | |||
| 731edf5872 | |||
| 7b85039b17 | |||
| 2bc45fa574 | |||
| d2b4455205 | |||
| bce4a26197 | |||
| 1da5040d60 | |||
| afd33e053b | |||
| 171d03c006 | |||
| 34d5237aaa | |||
| 037c3d6a05 | |||
| 5596ba634e | |||
| a5f69065f4 | |||
| 969ef249ea | |||
| a37183851f | |||
| 4cf3e1a769 | |||
| 354e5a2761 | |||
| c9fd8cc2a7 | |||
| bb19f752a1 | |||
| 6bd9c1055c | |||
| dff77097c6 | |||
| b4dc1c5661 | |||
| 992338d924 | |||
| f88a402b0c | |||
| 5938d36149 | |||
| 78577db3f9 | |||
| 0b4a6b77e2 | |||
| 01084a8897 | |||
| 0f18a1979e | |||
| 68a615bc7b | |||
| add1068c1a | |||
| 7a40df9965 | |||
| 3e6a1aa59a | |||
| d3fe79cf39 | |||
| 48fa547c8f | |||
| 80e2f7df71 | |||
| 0107f1f58a | |||
| d29c9a96f4 | |||
| 37d75c3281 | |||
| 666ded7b89 | |||
| 73a882f75e | |||
| 310f5f2349 | |||
| 8c86d6b696 | |||
| 82cd163adc | |||
| 802ee25621 | |||
| f48ebb65ba | |||
| aaa2a8ed2c | |||
| 5a06f5420b | |||
| 343f5a44f2 | |||
| 92125aee3a | |||
| 96f651b7ca | |||
| 06ea01e928 | |||
| 577f1e429a | |||
| 7808f64fe5 | |||
| e6789e49e4 | |||
| 797619aece | |||
| 1b5363611d | |||
| 103f773286 | |||
| d9ef0b587e | |||
| d5b98256f0 | |||
| efcceaa898 | |||
| e4aad11965 | |||
| 47207fad52 | |||
| 202bf82896 | |||
| 0e3274a743 | |||
| b06174926d | |||
| abb23a3c02 | |||
| 0c8f232282 | |||
| ef023d27bf | |||
| 7a591825eb | |||
| e71c49d596 | |||
| e6ce8995ba | |||
| f6250b6d5b | |||
| 757eff2937 | |||
| 996a7f3ddf | |||
| 94c050bacb | |||
| 3f4aa59a29 | |||
| bee7cf4278 | |||
| b9db6f0b40 | |||
| 8967cba3c7 | |||
| d04ad2eea9 | |||
| f2d3880a06 | |||
| ec5f70ecfc | |||
| 40b3fe7165 | |||
| 4095f1e946 | |||
| e219fc47ba | |||
| 6e2e7a4af5 | |||
| 2e7f764d6c | |||
| ce64de5b3d | |||
| 35ca1dd7ea | |||
| 8d0ad6b871 | |||
| 0aa4791cf7 | |||
| 082c2b46d0 | |||
| 50420f9052 | |||
| 499cbf8a60 | |||
| 2e38284d6e | |||
| 00cc3a11c6 | |||
| 9909a7f7b0 | |||
| 3363fca160 | |||
| 78e0b09c7a | |||
| caa3ffc8f5 | |||
| 323fb6a5fe | |||
| 1adc5f1729 | |||
| 78079252c9 | |||
| 72fdabd099 | |||
| 64bd6aa055 | |||
| 6329200b84 | |||
| 3f3fd16110 | |||
| 34f0c4ac2d | |||
| dde04d514e | |||
| ffddadd798 | |||
| 5dca337b92 | |||
| 131df181e6 | |||
| e207952786 | |||
| 3f7ef284fc | |||
| 1a41533d15 | |||
| 85f7bbbf1a | |||
| ccc603b59f | |||
| 8135f99616 | |||
| 713f4ae18b | |||
| f3f5d0bbd1 | |||
| 4a9e11c480 | |||
| cd94326aad | |||
| a4b971bba0 | |||
| 5d1609111c | |||
| d54ccaf629 | |||
| 6adea240e2 | |||
| 3486d403d2 | |||
| f533186c8d | |||
| 0beadf8e5a | |||
| 8bc06f0476 | |||
| 8fd8f74b27 | |||
| 9fc9b60de5 | |||
| 2a026726db | |||
| f9a99f8b09 | |||
| 95b8dc765d | |||
| 052d6e25e7 | |||
| fd82486bbc | |||
| ef07f7555f | |||
| 67859b7be0 | |||
| 1e5ddadd00 | |||
| 7bab76d765 | |||
| 416f243bda | |||
| 77ad112f67 | |||
| dc3d639824 | |||
| 13a001c258 | |||
| 85bdd97d48 | |||
| 3d9c8699e7 | |||
| ea482dab48 | |||
| 96a41eb2cc | |||
| e5dfb20aa2 | |||
| fe308d35f2 | |||
| 219b90fc5d | |||
| 44e2ca07e5 | |||
| 79d684caae | |||
| 4db8734a34 | |||
| 8b7baf7f86 | |||
| 28145e876f | |||
| 53625cf87b | |||
| 88f9779dd0 | |||
| 561a44b26b | |||
| 26068aaf6f | |||
| fb0f9dc608 | |||
| 6c44d38c10 | |||
| da3ab02a8d | |||
| 9c7703eb2d | |||
| 84922794fb | |||
| 1dcce99d87 | |||
| fd62aa469a | |||
| 63d307b95a | |||
| 9f12971eda | |||
| 47edd4f583 | |||
| e94b7b23e4 | |||
| 5c77e6c56d | |||
| 522cbe0e6e | |||
| f7061f360d | |||
| 16cdfa0426 | |||
| 74bd0c161f | |||
| da595e1eb9 | |||
| 5277c0de7d | |||
| b3c85e00f9 | |||
| 0748652a8d | |||
| 9fa0442b20 | |||
| bc6920f829 | |||
| d576a95548 | |||
| 99eca546d2 | |||
| b5d0fc6d0d | |||
| 17b36f01b0 | |||
| 5a6d1c72fe | |||
| 030fade7b6 | |||
| 60177d5a8e | |||
| a28fb72e36 | |||
| 5e15543bab | |||
| e1365ed343 | |||
| abb5d10a54 | |||
| c58ca510cc | |||
| 781bad9573 | |||
| 7e94f42b10 | |||
| 0b8d752773 | |||
| e6096b644f | |||
| 6b2c18ad75 | |||
| 8b5bc444f1 | |||
| d2915fe30c | |||
| b9522ade5d | |||
| f6513a0cf3 | |||
| d7ec4d087c | |||
| 25fca1ed56 | |||
| b9822f2270 | |||
| 11d03cef0c | |||
| 1c9276b4a1 | |||
| 4f7cfb087a | |||
| 93768fb4d9 | |||
| f6b6a8aa1b | |||
| 1be5862dc4 | |||
| 3e182db019 | |||
| 8ac1eba378 | |||
| eca9ba7b82 | |||
| 6699c32f73 | |||
| cadaeda3bf | |||
| 62acd38492 | |||
| 01c6c306b1 | |||
| 1de1b6e05f | |||
| 6f1fc314b6 | |||
| d84ffcc2b7 | |||
| f934890fac | |||
| ebc1ab649e | |||
| 0738e51852 | |||
| 90d84f9316 | |||
| fa10d5d4d5 | |||
| 8ed3eb24c3 | |||
| c60fe13d71 | |||
| 59c8d456cb | |||
| c0450f21b6 | |||
| 0e7dc67d9d | |||
| f38b5261d5 | |||
| 8230d9cd9b | |||
| 24da0b79c2 | |||
| 1c6bb682ea | |||
| 9d2d96c52a | |||
| e455785140 | |||
| dabbe0b6e7 | |||
| 4c123ed0ec | |||
| 838795fd34 | |||
| c398c714a3 | |||
| 8c5e4537a6 | |||
| 06b2163aaa | |||
| cf492daa93 | |||
| bddae046a0 | |||
| 2a0d4ef4dd | |||
| 8b3b645fbb | |||
| c8096e3334 | |||
| 89d1d9c6c3 | |||
| c2cd3b9c44 | |||
| 9654a4d8c9 | |||
| 9d0c583399 | |||
| c59c822fbf | |||
| 2a257ec5b2 | |||
| 8ce6b53cd5 | |||
| 5ce44651bf | |||
| dac0ef1507 | |||
| 57c39e9091 | |||
| 4f6d3cb10e | |||
| 4665d1d0ea | |||
| 89cfd5388f | |||
| f41179965d | |||
| f8f83c52a1 | |||
| 83b88039e4 | |||
| 23a7d8af23 | |||
| b2ebd5ee94 | |||
| f9284e9d8e | |||
| 0d8878abef | |||
| 0137309d3a | |||
| 4c329881a1 | |||
| 3b4a3fad5a | |||
| bac1ce5b7a | |||
| 6113fd9986 | |||
| ae2cfdafdd | |||
| de3f7bff60 | |||
| 97dfcb4c04 | |||
| 1bb1b8704b | |||
| 918d998f4c | |||
| 24edbdd025 | |||
| 015a3b633a | |||
| 101d720f2a | |||
| 8b76eb3ccc | |||
| 1e8d2172bc | |||
| 8bc367ab48 | |||
| 73b484d894 | |||
| 5c0ee92d85 | |||
| e67f568069 | |||
| 5845128479 | |||
| 6505f31ad5 | |||
| 30cc74c8eb | |||
| eb0787c198 | |||
| 0f17aff8fd | |||
| 14a73e4010 | |||
| 0fd6a24f5a | |||
| 7eab688d9c | |||
| 562bacbe22 | |||
| 8b423310a6 | |||
| 7268ebab4a | |||
| 8191359953 | |||
| c9fc9ffea5 | |||
| 1a78dada61 | |||
| 85cc4b4ecc | |||
| fc6a8a0803 | |||
| 3d8cdaf46c | |||
| 0e7b0bc45c | |||
| 74fcfd7778 | |||
| c9c745c730 | |||
| dd994cb16d | |||
| 861ef3db31 | |||
| f33bac012a | |||
| 4294632909 | |||
| 449ca74e44 | |||
| 52980f0b55 | |||
| 8e97dcda9c | |||
| 4ce810bdcd | |||
| 24a463b85b | |||
| 700d0194be | |||
| 34a8d48df9 | |||
| 8db028db1c |
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"toolchains": [],
|
||||
"backend.maxHeapSizeMb": 896
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: esengine # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: ['https://github.com/esengine/ecs-framework/blob/master/sponsor/alipay.jpg', 'https://github.com/esengine/ecs-framework/blob/master/sponsor/wechatpay.png'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
@@ -0,0 +1,84 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master, main, develop ]
|
||||
paths:
|
||||
- 'packages/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- 'tsconfig.json'
|
||||
- 'jest.config.*'
|
||||
- '.github/workflows/ci.yml'
|
||||
pull_request:
|
||||
branches: [ master, main, develop ]
|
||||
paths:
|
||||
- 'packages/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- 'tsconfig.json'
|
||||
- 'jest.config.*'
|
||||
- '.github/workflows/ci.yml'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build core package first
|
||||
run: npm run build:core
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: npm run test:ci
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
file: ./coverage/lcov.info
|
||||
flags: unittests
|
||||
name: codecov-umbrella
|
||||
fail_ci_if_error: false
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build project
|
||||
run: npm run build
|
||||
|
||||
- name: Build npm package
|
||||
run: npm run build:npm
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: build-artifacts
|
||||
path: |
|
||||
bin/
|
||||
dist/
|
||||
retention-days: 7
|
||||
@@ -0,0 +1,67 @@
|
||||
name: Deploy Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
paths:
|
||||
- 'docs/**'
|
||||
- 'packages/**'
|
||||
- 'typedoc.json'
|
||||
- 'package.json'
|
||||
- '.github/workflows/docs.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: pages
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.x'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build core package
|
||||
run: npm run build:core
|
||||
|
||||
- name: Generate API documentation
|
||||
run: npm run docs:api
|
||||
|
||||
- name: Build documentation
|
||||
run: npm run docs:build
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: docs/.vitepress/dist
|
||||
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
@@ -1,34 +0,0 @@
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [8.x]
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: cmd
|
||||
working-directory: ./source
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
- run: npm run build --if-present
|
||||
- run: gulp build
|
||||
@@ -1,9 +1,71 @@
|
||||
/source/node_modules
|
||||
/demo/bin-debug
|
||||
/demo/bin-release
|
||||
/.idea
|
||||
/.vscode
|
||||
/demo_wxgame
|
||||
/demo/.wing
|
||||
/demo/.idea
|
||||
/demo/.vscode
|
||||
# 依赖目录
|
||||
node_modules/
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# 构建输出
|
||||
bin/
|
||||
dist/
|
||||
*.tgz
|
||||
|
||||
# TypeScript
|
||||
*.tsbuildinfo
|
||||
|
||||
# 临时文件
|
||||
*.tmp
|
||||
*.temp
|
||||
.cache/
|
||||
|
||||
# IDE 配置
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# 操作系统文件
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# 日志文件
|
||||
logs/
|
||||
*.log
|
||||
|
||||
# 环境配置
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# 测试覆盖率
|
||||
coverage/
|
||||
*.lcov
|
||||
|
||||
# 包管理器锁文件(保留npm的,忽略其他的)
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
|
||||
# 文档生成
|
||||
docs/api/
|
||||
docs/build/
|
||||
docs/.vitepress/cache/
|
||||
docs/.vitepress/dist/
|
||||
|
||||
# 备份文件
|
||||
*.bak
|
||||
*.backup
|
||||
|
||||
# 演示项目构建产物
|
||||
/demo/bin-debug/
|
||||
/demo/bin-release/
|
||||
/demo/.wing/
|
||||
/demo/.idea/
|
||||
/demo/.vscode/
|
||||
/demo_wxgame/
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
[submodule "thirdparty/BehaviourTree-ai"]
|
||||
path = thirdparty/BehaviourTree-ai
|
||||
url = https://github.com/esengine/BehaviourTree-ai.git
|
||||
[submodule "thirdparty/admin-backend"]
|
||||
path = thirdparty/admin-backend
|
||||
url = https://github.com/esengine/admin-backend.git
|
||||
[submodule "extensions/cocos/cocos-ecs/extensions/cocos-ecs-extension"]
|
||||
path = extensions/cocos/cocos-ecs/extensions/cocos-ecs-extension
|
||||
url = https://github.com/esengine/cocos-ecs-extension.git
|
||||
[submodule "extensions/cocos/cocos-ecs/extensions/behaviour-tree"]
|
||||
path = extensions/cocos/cocos-ecs/extensions/behaviour-tree
|
||||
url = https://github.com/esengine/behaviour-tree.git
|
||||
[submodule "extensions/cocos/cocos-ecs/extensions/cocos-terrain-gen"]
|
||||
path = extensions/cocos/cocos-ecs/extensions/cocos-terrain-gen
|
||||
url = https://github.com/esengine/cocos-terrain-gen.git
|
||||
[submodule "extensions/cocos/cocos-ecs/extensions/mvvm-designer"]
|
||||
path = extensions/cocos/cocos-ecs/extensions/mvvm-designer
|
||||
url = https://github.com/esengine/mvvm-designer.git
|
||||
[submodule "thirdparty/mvvm-ui-framework"]
|
||||
path = thirdparty/mvvm-ui-framework
|
||||
url = https://github.com/esengine/mvvm-ui-framework.git
|
||||
[submodule "thirdparty/cocos-nexus"]
|
||||
path = thirdparty/cocos-nexus
|
||||
url = https://github.com/esengine/cocos-nexus.git
|
||||
[submodule "extensions/cocos/cocos-ecs/extensions/utilityai_designer"]
|
||||
path = extensions/cocos/cocos-ecs/extensions/utilityai_designer
|
||||
url = https://github.com/esengine/utilityai_designer.git
|
||||
[submodule "thirdparty/ecs-astar"]
|
||||
path = thirdparty/ecs-astar
|
||||
url = https://github.com/esengine/ecs-astar.git
|
||||
[submodule "examples/lawn-mower-demo"]
|
||||
path = examples/lawn-mower-demo
|
||||
url = https://github.com/esengine/lawn-mower-demo.git
|
||||
@@ -0,0 +1,40 @@
|
||||
# 源代码文件
|
||||
src/
|
||||
tsconfig*.json
|
||||
*.ts
|
||||
!bin/**/*.d.ts
|
||||
|
||||
# 开发文件
|
||||
dev-bin/
|
||||
scripts/
|
||||
.vscode/
|
||||
.git/
|
||||
.gitignore
|
||||
|
||||
# 测试文件
|
||||
**/*.test.*
|
||||
**/*.spec.*
|
||||
**/test/
|
||||
**/tests/
|
||||
|
||||
# 构建缓存
|
||||
node_modules/
|
||||
*.log
|
||||
*.tmp
|
||||
*.temp
|
||||
|
||||
# 文档草稿
|
||||
docs/draft/
|
||||
*.draft.md
|
||||
|
||||
# 编辑器文件
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# 环境文件
|
||||
.env
|
||||
.env.local
|
||||
.env.*.local
|
||||
@@ -1,139 +1,127 @@
|
||||
Cegret-framework
|
||||
# ECS Framework
|
||||
|
||||
[](https://github.com/esengine/ecs-framework/actions)
|
||||
[](https://badge.fury.io/js/%40esengine%2Fecs-framework)
|
||||
[](https://www.typescriptlang.org/)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
[](https://github.com/esengine/ecs-framework/stargazers)
|
||||
|
||||
[](https://lgtm.com/projects/g/esengine/egret-framework/context:javascript)
|
||||
一个高性能的 TypeScript ECS (Entity-Component-System) 框架,专为现代游戏开发而设计。
|
||||
|
||||
这是一套用于egret的游戏框架,里面包含ECS框架用于管理场景实体,一些常用2D碰撞检测及A*寻路。如果您还需要包含其他的AI系统可以查看作者其他库(行为树、简易FSM、实用AI)。
|
||||
## 特性
|
||||
|
||||
## 在线框架演示
|
||||
- **高性能** - 针对大规模实体优化,支持SoA存储和批量处理
|
||||
- **多线程计算** - Worker系统支持真正的并行处理,充分利用多核CPU性能
|
||||
- **类型安全** - 完整的TypeScript支持,编译时类型检查
|
||||
- **现代架构** - 支持多World、多Scene的分层架构设计
|
||||
- **开发友好** - 内置调试工具和性能监控
|
||||
- **跨平台** - 支持Cocos Creator、Laya引擎和Web平台
|
||||
|
||||
[非完整游戏演示](http://www.hyuan.org/samples)
|
||||
## 安装
|
||||
|
||||
## 入门教程
|
||||
```bash
|
||||
npm install @esengine/ecs-framework
|
||||
```
|
||||
|
||||
[Getting Start](https://github.com/esengine/egret-framework/wiki/Getting-Start)
|
||||
## 快速开始
|
||||
|
||||
打开白鹭工程 替换 `Main.ts` 文件内容
|
||||
```typescript
|
||||
import { Core, Scene, Component, EntitySystem, ECSComponent, ECSSystem, Matcher, Time } from '@esengine/ecs-framework';
|
||||
|
||||
```ts
|
||||
class Main extends es.Core {
|
||||
/**
|
||||
* 由监听事件 egret.Event.ADDED_TO_STAGE后触发的事件
|
||||
*/
|
||||
protected initialize() {
|
||||
// 初始化游戏逻辑
|
||||
// 定义组件
|
||||
@ECSComponent('Position')
|
||||
class Position extends Component {
|
||||
constructor(public x = 0, public y = 0) {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* 由监听事件 egret.Event.ENTER_FRAME后触发的事件
|
||||
*/
|
||||
protected async update(){
|
||||
// 如果需要更新方法 不能删除super.update()
|
||||
// 会导致框架内所有组件及实体无法更新
|
||||
super.update();
|
||||
|
||||
// 更新逻辑
|
||||
}
|
||||
|
||||
@ECSComponent('Velocity')
|
||||
class Velocity extends Component {
|
||||
constructor(public dx = 0, public dy = 0) {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* 在update方法执行完毕后执行 draw方法
|
||||
*/
|
||||
public async draw(){
|
||||
// 如果需要绘制方法 不能删除super.draw()
|
||||
// 会导致框架内所有渲染组件位置无法更新
|
||||
super.draw();
|
||||
|
||||
// 绘制逻辑
|
||||
}
|
||||
|
||||
// 创建系统
|
||||
@ECSSystem('Movement')
|
||||
class MovementSystem extends EntitySystem {
|
||||
constructor() {
|
||||
super(Matcher.all(Position, Velocity));
|
||||
}
|
||||
|
||||
protected process(entities: readonly Entity[]): void {
|
||||
for (const entity of entities) {
|
||||
const position = entity.getComponent(Position)!;
|
||||
const velocity = entity.getComponent(Velocity)!;
|
||||
|
||||
position.x += velocity.dx * Time.deltaTime;
|
||||
position.y += velocity.dy * Time.deltaTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 创建场景并启动
|
||||
class GameScene extends Scene {
|
||||
protected initialize(): void {
|
||||
this.addSystem(new MovementSystem());
|
||||
|
||||
const player = this.createEntity("Player");
|
||||
player.addComponent(new Position(100, 100));
|
||||
player.addComponent(new Velocity(50, 0));
|
||||
}
|
||||
}
|
||||
|
||||
// 启动游戏
|
||||
Core.create();
|
||||
Core.setScene(new GameScene());
|
||||
|
||||
// 游戏循环中更新
|
||||
function gameLoop(deltaTime: number) {
|
||||
Core.update(deltaTime);
|
||||
}
|
||||
```
|
||||
|
||||
## 核心特性
|
||||
|
||||
- **实体查询** - 使用 Matcher API 进行高效的实体过滤
|
||||
- **事件系统** - 类型安全的事件发布/订阅机制
|
||||
- **性能优化** - SoA 存储优化,支持大规模实体处理
|
||||
- **多线程支持** - Worker系统实现真正的并行计算,充分利用多核CPU
|
||||
- **多场景** - 支持 World/Scene 分层架构
|
||||
- **时间管理** - 内置定时器和时间控制系统
|
||||
|
||||
## 平台支持
|
||||
|
||||
支持主流游戏引擎和 Web 平台:
|
||||
|
||||
- **Cocos Creator** - 内置引擎集成支持,提供[专用调试插件](https://store.cocos.com/app/detail/7823)
|
||||
- **Laya 引擎** - 完整的生命周期管理
|
||||
- **原生 Web** - 浏览器环境直接运行
|
||||
- **小游戏平台** - 微信、支付宝等小游戏
|
||||
|
||||
|
||||
## 版本计划功能
|
||||
## 示例项目
|
||||
|
||||
- [x] 简易ECS框架
|
||||
- [x] 组件列表
|
||||
- [x] 碰撞组件
|
||||
- [x] 移动组件
|
||||
- [x] 滚动精灵组件
|
||||
- [x] 平铺精灵组件
|
||||
- [x] 序列帧动画组件
|
||||
- [x] 相机震动组件
|
||||
- [x] 相机组件
|
||||
- [x] 组件池
|
||||
- [x] 基础碰撞组件(矩形、圆形、多边形碰撞)
|
||||
- [x] 场景组件
|
||||
- [x] 系统列表
|
||||
- [x] 被动系统
|
||||
- [x] 协调系统
|
||||
- [x] 实体系统
|
||||
- [x] 实体解析系统
|
||||
- [x] 扩展库
|
||||
- [x] object扩展
|
||||
- [x] string扩展
|
||||
- [x] texture扩展
|
||||
- [x] time扩展
|
||||
- [x] [array扩展(Extension)](https://github.com/esengine/egret-framework/wiki/Array-%E6%89%A9%E5%B1%95%E8%AF%B4%E6%98%8E)
|
||||
- [x] base64扩展
|
||||
- [x] Stopwatch计数器
|
||||
- [x] Input输入帮助
|
||||
- [x] Keyboard键盘帮助
|
||||
- [x] List池对象
|
||||
- [x] Lock锁帮助
|
||||
- [x] Emitter事件发射器
|
||||
- [x] Random随机类帮助
|
||||
- [x] Rectangle矩形帮助类
|
||||
- [x] Vector2向量帮助类
|
||||
- [x] Content资源管理器
|
||||
- [x] 全局管理器
|
||||
- [x] 向量集Bitset
|
||||
- [x] 图形帮助
|
||||
- [x] 场景过渡
|
||||
- [x] 后处理器
|
||||
- [x] 场景渲染器
|
||||
- [x] 特效组
|
||||
- [x] A*寻路(AStar)
|
||||
- [x] 常用碰撞检测
|
||||
- [x] 数学库
|
||||
- [x] 矩形类(Rectangle)
|
||||
- [x] 简易2D矩阵类(Matrix2D)
|
||||
- [x] 简易2d 向量类(Vector2)
|
||||
- [x] 数学扩展库(MathHelper)
|
||||
- [x] 掩码实用类(Flags)
|
||||
- [x] 贝塞尔曲线(Bezier)
|
||||
- [x] 物理系统(简易)
|
||||
- [x] Collision碰撞检测
|
||||
- [x] ColliderTrigger帮助
|
||||
- [x] Ray2D射线检测
|
||||
- [x] ShapeCollision 多种形状检测
|
||||
- [x] RealtimeCollisions 实时碰撞检测
|
||||
- [x] SpatialHash 网格检测
|
||||
- [x] BreadthFirst 寻路算法
|
||||
- [x] Dijkstra 寻路算法
|
||||
- [x] 事件处理器
|
||||
- [Worker系统演示](https://esengine.github.io/ecs-framework/demos/worker-system/) - 多线程物理系统演示,展示高性能并行计算
|
||||
- [割草机演示](https://github.com/esengine/lawn-mower-demo) - 完整的游戏示例
|
||||
|
||||
## 关于egret用ecs框架(typescript/javascript)
|
||||
ecs 是功能强大的实体组件系统。typescript与其他语言不同,因此我对ecs的设计尽可能的支持typescript特性。虽然ecs拥有标准实体组件系统,但在细节上有很大不同。创建标准ecs通常处于原始速度、缓存位置和其他性能原因。使用typescript,我们没有struct,因为没有必要匹配标准实体组件系统的设计方式,因为我们对内存布局没有那种控制。
|
||||
## 文档
|
||||
|
||||
ecs更灵活,可以更好的集中、组织、排序和过滤游戏中的对象。ecs让您拥有轻量级实体和组件,这些组件可以由系统批量处理。
|
||||
例如,您在制作一个射手,您可能会有几十到几百个子弹,这些作为轻量级实体由系统批量处理。
|
||||
- [快速入门](https://esengine.github.io/ecs-framework/guide/getting-started.html) - 详细教程和平台集成
|
||||
- [完整指南](https://esengine.github.io/ecs-framework/guide/) - ECS 概念和使用指南
|
||||
- [API 参考](https://esengine.github.io/ecs-framework/api/) - 完整 API 文档
|
||||
|
||||
所以ecs在设计当中拥有四种重要类型:世界(Scene),过滤器(Matcher),系统(System)和实体(Entity)
|
||||
## 生态系统
|
||||
|
||||
## 世界(Scene)
|
||||
Scene是ecs包含系统和实体最外面的容器。
|
||||
- [路径寻找](https://github.com/esengine/ecs-astar) - A*、BFS、Dijkstra 算法
|
||||
- [AI 系统](https://github.com/esengine/BehaviourTree-ai) - 行为树、效用 AI
|
||||
|
||||
## 实体(Entity)
|
||||
实体只由系统处理。
|
||||
## 社区与支持
|
||||
|
||||
## 组件(Component)
|
||||
组件应该只包含数据而没有逻辑代码。对数据进行逻辑是系统的工作。
|
||||
- [问题反馈](https://github.com/esengine/ecs-framework/issues) - Bug 报告和功能建议
|
||||
- [QQ 交流群](https://jq.qq.com/?_wv=1027&k=29w1Nud6) - ecs游戏框架交流
|
||||
|
||||
## 系统(System)
|
||||
ecs中的系统会不断的更新实体。系统使用过滤器选择某些实体,然后仅更新那些选择的实体。
|
||||
|
||||
## 作者其他库(egret)
|
||||
|
||||
- [行为树/实用AI 系统](https://github.com/esengine/egret-BehaviourTree-ai)
|
||||
## 许可证
|
||||
|
||||
[MIT](LICENSE) © 2025 ECS Framework
|
||||
@@ -1,21 +1,53 @@
|
||||
# Security Policy
|
||||
# 安全政策
|
||||
|
||||
## Supported Versions
|
||||
## 支持的版本
|
||||
|
||||
Use this section to tell people about which versions of your project are
|
||||
currently being supported with security updates.
|
||||
我们为以下版本提供安全更新:
|
||||
|
||||
| Version | Supported |
|
||||
| 版本 | 支持状态 |
|
||||
| ------- | ------------------ |
|
||||
| 5.1.x | :white_check_mark: |
|
||||
| 5.0.x | :x: |
|
||||
| 4.0.x | :white_check_mark: |
|
||||
| < 4.0 | :x: |
|
||||
| 2.0.x | :white_check_mark: |
|
||||
| 1.0.x | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
## 报告漏洞
|
||||
|
||||
Use this section to tell people how to report a vulnerability.
|
||||
如果您发现了安全漏洞,请通过以下方式报告:
|
||||
|
||||
Tell them where to go, how often they can expect to get an update on a
|
||||
reported vulnerability, what to expect if the vulnerability is accepted or
|
||||
declined, etc.
|
||||
### 报告渠道
|
||||
|
||||
- **邮箱**: [安全邮箱将在实际部署时提供]
|
||||
- **GitHub**: 创建私有安全报告(推荐)
|
||||
|
||||
### 报告流程
|
||||
|
||||
1. **不要**在公开的 issue 中报告安全漏洞
|
||||
2. 提供详细的漏洞描述,包括:
|
||||
- 受影响的版本
|
||||
- 复现步骤
|
||||
- 潜在的影响范围
|
||||
- 如果可能,提供修复建议
|
||||
|
||||
### 响应时间
|
||||
|
||||
- **确认收到**: 72小时内
|
||||
- **初步评估**: 1周内
|
||||
- **修复发布**: 根据严重程度,通常在2-4周内
|
||||
|
||||
### 处理流程
|
||||
|
||||
1. 我们会确认漏洞的存在和严重程度
|
||||
2. 开发修复方案并进行测试
|
||||
3. 发布安全更新
|
||||
4. 在修复发布后,会在相关渠道公布漏洞详情
|
||||
|
||||
### 安全最佳实践
|
||||
|
||||
使用 ECS Framework 时,请遵循以下安全建议:
|
||||
|
||||
- 始终使用最新的稳定版本
|
||||
- 定期更新依赖项
|
||||
- 在生产环境中禁用调试模式
|
||||
- 验证所有外部输入数据
|
||||
- 不要在客户端存储敏感信息
|
||||
|
||||
感谢您帮助保持 ECS Framework 的安全性!
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
theme: jekyll-theme-slate
|
||||
@@ -1,39 +0,0 @@
|
||||
{
|
||||
"engineVersion": "5.2.33",
|
||||
"compilerVersion": "5.2.33",
|
||||
"template": {},
|
||||
"target": {
|
||||
"current": "web"
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"name": "egret"
|
||||
},
|
||||
{
|
||||
"name": "eui"
|
||||
},
|
||||
{
|
||||
"name": "assetsmanager"
|
||||
},
|
||||
{
|
||||
"name": "game"
|
||||
},
|
||||
{
|
||||
"name": "tween"
|
||||
},
|
||||
{
|
||||
"name": "promise"
|
||||
},
|
||||
{
|
||||
"name": "dragonBones"
|
||||
},
|
||||
{
|
||||
"name": "framework",
|
||||
"path": "./libs/framework"
|
||||
},
|
||||
{
|
||||
"name": "fairygui",
|
||||
"path": "./libs/fairygui"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -1,95 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Egret</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="full-screen" content="true" />
|
||||
<meta name="screen-orientation" content="portrait" />
|
||||
<meta name="x5-fullscreen" content="true" />
|
||||
<meta name="360-fullscreen" content="true" />
|
||||
<style>
|
||||
html, body {
|
||||
-ms-touch-action: none;
|
||||
background: #888888;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div style="margin: auto;width: 100%;height: 100%;" class="egret-player"
|
||||
data-entry-class="Main"
|
||||
data-orientation="auto"
|
||||
data-scale-mode="fixedWidth"
|
||||
data-frame-rate="60"
|
||||
data-content-width="640"
|
||||
data-content-height="1136"
|
||||
data-multi-fingered="2"
|
||||
data-show-fps="false" data-show-log="false"
|
||||
data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
|
||||
</div>
|
||||
<script>
|
||||
var loadScript = function (list, callback) {
|
||||
var loaded = 0;
|
||||
var loadNext = function () {
|
||||
loadSingleScript(list[loaded], function () {
|
||||
loaded++;
|
||||
if (loaded >= list.length) {
|
||||
callback();
|
||||
}
|
||||
else {
|
||||
loadNext();
|
||||
}
|
||||
})
|
||||
};
|
||||
loadNext();
|
||||
};
|
||||
|
||||
var loadSingleScript = function (src, callback) {
|
||||
var s = document.createElement('script');
|
||||
s.async = false;
|
||||
s.src = src;
|
||||
s.addEventListener('load', function () {
|
||||
s.parentNode.removeChild(s);
|
||||
s.removeEventListener('load', arguments.callee, false);
|
||||
callback();
|
||||
}, false);
|
||||
document.body.appendChild(s);
|
||||
};
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', './manifest.json?v=' + Math.random(), true);
|
||||
xhr.addEventListener("load", function () {
|
||||
var manifest = JSON.parse(xhr.response);
|
||||
var list = manifest.initial.concat(manifest.game);
|
||||
loadScript(list, function () {
|
||||
/**
|
||||
* {
|
||||
* "renderMode":, //Engine rendering mode, "canvas" or "webgl"
|
||||
* "audioType": 0 //Use the audio type, 0: default, 2: web audio, 3: audio
|
||||
* "antialias": //Whether the anti-aliasing is enabled in WebGL mode, true: on, false: off, defaults to false
|
||||
* "calculateCanvasScaleFactor": //a function return canvas scale factor
|
||||
* }
|
||||
**/
|
||||
egret.runEgret({ renderMode: "webgl", audioType: 0, calculateCanvasScaleFactor:function(context) {
|
||||
var backingStore = context.backingStorePixelRatio ||
|
||||
context.webkitBackingStorePixelRatio ||
|
||||
context.mozBackingStorePixelRatio ||
|
||||
context.msBackingStorePixelRatio ||
|
||||
context.oBackingStorePixelRatio ||
|
||||
context.backingStorePixelRatio || 1;
|
||||
return (window.devicePixelRatio || 1) / backingStore;
|
||||
}});
|
||||
});
|
||||
});
|
||||
xhr.send(null);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,52 +0,0 @@
|
||||
declare module skins{
|
||||
class ButtonSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class CheckBoxSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class HScrollBarSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class HSliderSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class ItemRendererSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class PanelSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class ProgressBarSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class RadioButtonSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class ScrollerSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class TextInputSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class ToggleSwitchSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class VScrollBarSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
declare module skins{
|
||||
class VSliderSkin extends eui.Skin{
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"initial": [
|
||||
"libs/modules/egret/egret.js",
|
||||
"libs/modules/egret/egret.web.js",
|
||||
"libs/modules/eui/eui.js",
|
||||
"libs/modules/assetsmanager/assetsmanager.js",
|
||||
"libs/modules/game/game.js",
|
||||
"libs/modules/tween/tween.js",
|
||||
"libs/modules/promise/promise.js",
|
||||
"libs/modules/dragonBones/dragonBones.js",
|
||||
"libs/framework/framework.js",
|
||||
"libs/fairygui/fairygui.js"
|
||||
],
|
||||
"game": [
|
||||
"bin-debug/Fgui/common/commonBinder.js",
|
||||
"bin-debug/UI/mvc/BaseView.js",
|
||||
"bin-debug/SampleHelpers/SampleScene.js",
|
||||
"bin-debug/Scenes/Ninja Adventure/ProjectileHitDetector.js",
|
||||
"bin-debug/UI/loading/LoadingView.js",
|
||||
"bin-debug/Scenes/Ninja Adventure/CameraBounds.js",
|
||||
"bin-debug/Fgui/loading/loadingBinder.js",
|
||||
"bin-debug/Fgui/loading/UI_View_loading.js",
|
||||
"bin-debug/Fgui/sc/scBinder.js",
|
||||
"bin-debug/Fgui/sc/UI_btn_sc.js",
|
||||
"bin-debug/Fgui/sc/UI_combo_sc_popup.js",
|
||||
"bin-debug/Fgui/sc/UI_View_sc.js",
|
||||
"bin-debug/Platform.js",
|
||||
"bin-debug/Scenes/Animated Tiles/AnimatedTilesScene.js",
|
||||
"bin-debug/Scenes/Empty Scene/BasicScene.js",
|
||||
"bin-debug/Scenes/LineCasting/LineCaster.js",
|
||||
"bin-debug/Scenes/LineCasting/LineCastingScene.js",
|
||||
"bin-debug/Main.js",
|
||||
"bin-debug/Scenes/Ninja Adventure/FireballProjectileController.js",
|
||||
"bin-debug/Scenes/Ninja Adventure/Ninja.js",
|
||||
"bin-debug/Scenes/Ninja Adventure/NinjaAdventureScene.js",
|
||||
"bin-debug/ThemeAdapter.js",
|
||||
"bin-debug/UI/PopManager.js",
|
||||
"bin-debug/UI/loading/LoadingControl.js",
|
||||
"bin-debug/UI/loading/LoadingEvents.js",
|
||||
"bin-debug/AssetAdapter.js",
|
||||
"bin-debug/Fgui/common/UI_com_tips.js",
|
||||
"bin-debug/UI/mvc/EventManager.js",
|
||||
"bin-debug/UI/mvc/Extension.js",
|
||||
"bin-debug/UI/mvc/FguiUtils.js",
|
||||
"bin-debug/UI/mvc/LayerManager.js",
|
||||
"bin-debug/UI/mvc/ViewManager.js",
|
||||
"bin-debug/UI/sc/ScControl.js",
|
||||
"bin-debug/UI/sc/ScEvents.js",
|
||||
"bin-debug/UI/sc/ScView.js"
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,121 +0,0 @@
|
||||
{
|
||||
"groups": [
|
||||
{
|
||||
"keys": "bg_png,bgNorm_png,moon_png,orange_png,moonNorm_png,orangeNorm_png,tiledMap_json,orthogonal-outside_json,tilemap_json,plume_png",
|
||||
"name": "preload"
|
||||
},
|
||||
{
|
||||
"keys": "loading",
|
||||
"name": "loading"
|
||||
},
|
||||
{
|
||||
"keys": "sc",
|
||||
"name": "sc"
|
||||
},
|
||||
{
|
||||
"keys": "common",
|
||||
"name": "common"
|
||||
},
|
||||
{
|
||||
"keys": "1_png,2_png,3_png,4_png,5_png,6_png",
|
||||
"name": "characters"
|
||||
}
|
||||
],
|
||||
"resources": [
|
||||
{
|
||||
"url": "preload/bg.png",
|
||||
"type": "image",
|
||||
"name": "bg_png"
|
||||
},
|
||||
{
|
||||
"url": "preload/bgNorm.png",
|
||||
"type": "image",
|
||||
"name": "bgNorm_png"
|
||||
},
|
||||
{
|
||||
"url": "preload/moon.png",
|
||||
"type": "image",
|
||||
"name": "moon_png"
|
||||
},
|
||||
{
|
||||
"url": "preload/orange.png",
|
||||
"type": "image",
|
||||
"name": "orange_png"
|
||||
},
|
||||
{
|
||||
"url": "preload/moonNorm.png",
|
||||
"type": "image",
|
||||
"name": "moonNorm_png"
|
||||
},
|
||||
{
|
||||
"url": "preload/orangeNorm.png",
|
||||
"type": "image",
|
||||
"name": "orangeNorm_png"
|
||||
},
|
||||
{
|
||||
"url": "characters/1.png",
|
||||
"type": "image",
|
||||
"name": "1_png"
|
||||
},
|
||||
{
|
||||
"url": "characters/2.png",
|
||||
"type": "image",
|
||||
"name": "2_png"
|
||||
},
|
||||
{
|
||||
"url": "characters/3.png",
|
||||
"type": "image",
|
||||
"name": "3_png"
|
||||
},
|
||||
{
|
||||
"url": "characters/4.png",
|
||||
"type": "image",
|
||||
"name": "4_png"
|
||||
},
|
||||
{
|
||||
"url": "characters/5.png",
|
||||
"type": "image",
|
||||
"name": "5_png"
|
||||
},
|
||||
{
|
||||
"url": "characters/6.png",
|
||||
"type": "image",
|
||||
"name": "6_png"
|
||||
},
|
||||
{
|
||||
"url": "fgui/common.zip",
|
||||
"type": "bin",
|
||||
"name": "common"
|
||||
},
|
||||
{
|
||||
"url": "fgui/sc.zip",
|
||||
"type": "bin",
|
||||
"name": "sc"
|
||||
},
|
||||
{
|
||||
"url": "fgui/loading.zip",
|
||||
"type": "bin",
|
||||
"name": "loading"
|
||||
},
|
||||
{
|
||||
"url": "preload/caveman/tiledMap.json",
|
||||
"type": "json",
|
||||
"name": "tiledMap_json"
|
||||
},
|
||||
{
|
||||
"url": "preload/orthogonal/orthogonal-outside.json",
|
||||
"type": "json",
|
||||
"name": "orthogonal-outside_json"
|
||||
},
|
||||
{
|
||||
"url": "preload/ninja/tilemap.json",
|
||||
"type": "json",
|
||||
"name": "tilemap_json"
|
||||
},
|
||||
{
|
||||
"url": "preload/plume.png",
|
||||
"type": "image",
|
||||
"name": "plume_png"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
{
|
||||
"skins": {
|
||||
"eui.Button": "resource/eui_skins/ButtonSkin.exml",
|
||||
"eui.CheckBox": "resource/eui_skins/CheckBoxSkin.exml",
|
||||
"eui.HScrollBar": "resource/eui_skins/HScrollBarSkin.exml",
|
||||
"eui.HSlider": "resource/eui_skins/HSliderSkin.exml",
|
||||
"eui.Panel": "resource/eui_skins/PanelSkin.exml",
|
||||
"eui.TextInput": "resource/eui_skins/TextInputSkin.exml",
|
||||
"eui.ProgressBar": "resource/eui_skins/ProgressBarSkin.exml",
|
||||
"eui.RadioButton": "resource/eui_skins/RadioButtonSkin.exml",
|
||||
"eui.Scroller": "resource/eui_skins/ScrollerSkin.exml",
|
||||
"eui.ToggleSwitch": "resource/eui_skins/ToggleSwitchSkin.exml",
|
||||
"eui.VScrollBar": "resource/eui_skins/VScrollBarSkin.exml",
|
||||
"eui.VSlider": "resource/eui_skins/VSliderSkin.exml",
|
||||
"eui.ItemRenderer": "resource/eui_skins/ItemRendererSkin.exml"
|
||||
},
|
||||
"autoGenerateExmlsList": true,
|
||||
"exmls": [
|
||||
"resource/eui_skins/ButtonSkin.exml",
|
||||
"resource/eui_skins/CheckBoxSkin.exml",
|
||||
"resource/eui_skins/HScrollBarSkin.exml",
|
||||
"resource/eui_skins/HSliderSkin.exml",
|
||||
"resource/eui_skins/ItemRendererSkin.exml",
|
||||
"resource/eui_skins/PanelSkin.exml",
|
||||
"resource/eui_skins/ProgressBarSkin.exml",
|
||||
"resource/eui_skins/RadioButtonSkin.exml",
|
||||
"resource/eui_skins/ScrollerSkin.exml",
|
||||
"resource/eui_skins/TextInputSkin.exml",
|
||||
"resource/eui_skins/ToggleSwitchSkin.exml",
|
||||
"resource/eui_skins/VScrollBarSkin.exml",
|
||||
"resource/eui_skins/VSliderSkin.exml"
|
||||
],
|
||||
"path": "resource/default.thm.json"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 11 KiB |
@@ -1,193 +0,0 @@
|
||||
{ "height":30,
|
||||
"infinite":false,
|
||||
"layers":[
|
||||
{
|
||||
"data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2147483652, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2147483652, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2147483652, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2147483652, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 2147483652, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
|
||||
"height":30,
|
||||
"id":1,
|
||||
"name":"main",
|
||||
"opacity":1,
|
||||
"type":"tilelayer",
|
||||
"visible":true,
|
||||
"width":40,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"draworder":"topdown",
|
||||
"id":2,
|
||||
"name":"objects",
|
||||
"objects":[
|
||||
{
|
||||
"height":14.8796,
|
||||
"id":6,
|
||||
"name":"spawn",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":14.8796,
|
||||
"x":48.4346,
|
||||
"y":240.503
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"nextlayerid":3,
|
||||
"nextobjectid":7,
|
||||
"orientation":"orthogonal",
|
||||
"renderorder":"right-down",
|
||||
"tiledversion":"1.2.1",
|
||||
"tileheight":16,
|
||||
"tilesets":[
|
||||
{
|
||||
"columns":2,
|
||||
"firstgid":1,
|
||||
"image":"tileset.png",
|
||||
"imageheight":32,
|
||||
"imagewidth":32,
|
||||
"margin":0,
|
||||
"name":"tileset",
|
||||
"spacing":0,
|
||||
"tilecount":4,
|
||||
"tileheight":16,
|
||||
"tiles":[
|
||||
{
|
||||
"id":0,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":16,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":2,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":3,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":16,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
"properties":[
|
||||
{
|
||||
"name":"filewtf",
|
||||
"type":"file",
|
||||
"value":""
|
||||
},
|
||||
{
|
||||
"name":"floaty",
|
||||
"type":"float",
|
||||
"value":0
|
||||
},
|
||||
{
|
||||
"name":"inty",
|
||||
"type":"int",
|
||||
"value":0
|
||||
},
|
||||
{
|
||||
"name":"nez:isOneWayPlatform",
|
||||
"type":"bool",
|
||||
"value":true
|
||||
},
|
||||
{
|
||||
"name":"poop",
|
||||
"type":"color",
|
||||
"value":""
|
||||
}]
|
||||
},
|
||||
{
|
||||
"id":3,
|
||||
"objectgroup":
|
||||
{
|
||||
"draworder":"index",
|
||||
"name":"",
|
||||
"objects":[
|
||||
{
|
||||
"height":0,
|
||||
"id":1,
|
||||
"name":"",
|
||||
"polygon":[
|
||||
{
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
{
|
||||
"x":0,
|
||||
"y":16
|
||||
},
|
||||
{
|
||||
"x":16,
|
||||
"y":16
|
||||
}],
|
||||
"rotation":0,
|
||||
"type":"",
|
||||
"visible":true,
|
||||
"width":0,
|
||||
"x":0,
|
||||
"y":0
|
||||
}],
|
||||
"opacity":1,
|
||||
"type":"objectgroup",
|
||||
"visible":true,
|
||||
"x":0,
|
||||
"y":0
|
||||
},
|
||||
"properties":[
|
||||
{
|
||||
"name":"nez:isSlope",
|
||||
"type":"bool",
|
||||
"value":true
|
||||
},
|
||||
{
|
||||
"name":"nez:slopeTopLeft",
|
||||
"type":"int",
|
||||
"value":0
|
||||
},
|
||||
{
|
||||
"name":"nez:slopeTopRight",
|
||||
"type":"int",
|
||||
"value":15
|
||||
}]
|
||||
}],
|
||||
"tilewidth":16
|
||||
}],
|
||||
"tilewidth":16,
|
||||
"type":"map",
|
||||
"version":1.2,
|
||||
"width":40
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 770 B |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,452 +0,0 @@
|
||||
|
||||
/**
|
||||
* ResourceManager 配置文件
|
||||
*/
|
||||
type ResourceManagerConfig = {
|
||||
/**
|
||||
* 构建与发布配置
|
||||
*/
|
||||
buildConfig: (param: BuildConfigParam) => UserConfig,
|
||||
/**
|
||||
* 设置资源类型
|
||||
*/
|
||||
typeSelector: (path: string) => (string | null | undefined)
|
||||
/**
|
||||
* 设置资源的合并策略
|
||||
*/
|
||||
mergeSelector?: (path: string) => (string | null | undefined),
|
||||
/**
|
||||
* 设置资源的命名策略
|
||||
* beta 功能,请勿随意使用
|
||||
*/
|
||||
nameSelector?: (path: string) => (string | null | undefined)
|
||||
}
|
||||
/**
|
||||
* 构建配置
|
||||
*/
|
||||
type UserConfig = {
|
||||
/**
|
||||
* 输出路径
|
||||
*/
|
||||
outputDir: string,
|
||||
/**
|
||||
* 插件
|
||||
*/
|
||||
commands: (string | plugins.Command)[]
|
||||
}
|
||||
|
||||
type BuildConfigParam = {
|
||||
|
||||
|
||||
/**
|
||||
* 当前命令,build 或者 command
|
||||
*/
|
||||
readonly command: string;
|
||||
|
||||
/**
|
||||
* 发布平台
|
||||
*/
|
||||
readonly target: string;
|
||||
|
||||
/**
|
||||
* 开发者指定的版本号
|
||||
*/
|
||||
readonly version: string;
|
||||
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
readonly projectName: string;
|
||||
|
||||
/**
|
||||
* 项目路径
|
||||
*/
|
||||
readonly projectRoot: string;
|
||||
|
||||
/**
|
||||
* 项目配置
|
||||
*/
|
||||
readonly projectConfig: ProjectConfig;
|
||||
}
|
||||
|
||||
type ProjectConfig = {
|
||||
entryClassName: string;
|
||||
orientation: string;
|
||||
frameRate: number;
|
||||
scaleMode: string;
|
||||
contentWidth: number;
|
||||
contentHeight: number;
|
||||
showFPS: boolean;
|
||||
fpsStyles: string;
|
||||
showLog: boolean;
|
||||
maxTouches: number;
|
||||
}
|
||||
/**
|
||||
* 匹配机制,将满足 from 的文件输出为 to 格式的文件
|
||||
* from 采用 glob 表达式 , to 包含 [path][name][hash][ext]四个变量
|
||||
* 示例:{ from:"resource/**.*" , to:"[path][name]_[hash].[ext]" }
|
||||
*/
|
||||
type Matcher = {
|
||||
|
||||
from: string,
|
||||
|
||||
to: string
|
||||
|
||||
}
|
||||
|
||||
|
||||
declare namespace plugins {
|
||||
|
||||
interface CommandContext {
|
||||
|
||||
/**
|
||||
* 可以用此接口进行文件创建
|
||||
*/
|
||||
createFile(relativeFilePath: string, contents: Buffer);
|
||||
|
||||
/**
|
||||
* 构建配置
|
||||
*/
|
||||
buildConfig: BuildConfigParam;
|
||||
|
||||
/**
|
||||
* 项目绝对路径
|
||||
*/
|
||||
projectRoot: string;
|
||||
|
||||
/**
|
||||
* 项目输出绝对路径
|
||||
*/
|
||||
outputDir: string;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建管线命令
|
||||
*/
|
||||
interface Command {
|
||||
|
||||
/**
|
||||
* 项目中的每个文件都会执行此函数,返回 file 表示保留此文件,返回 null 表示将此文件从构建管线中删除,即不会发布
|
||||
*/
|
||||
onFile?(file: File): Promise<File | null>
|
||||
|
||||
/**
|
||||
* 项目中所有文件均执行完后,最终会执行此函数。
|
||||
* 这个函数主要被用于创建新文件
|
||||
*/
|
||||
onFinish?(pluginContext?: CommandContext): Promise<void>
|
||||
|
||||
[options: string]: any;
|
||||
}
|
||||
|
||||
interface File {
|
||||
|
||||
/**
|
||||
* 文件内容的二进制流,如果开发者需要修改文件内容,请修改此属性
|
||||
*/
|
||||
contents: Buffer;
|
||||
|
||||
|
||||
/**
|
||||
* 文件绝对路径,如果开发者需要对文件进行重命名,请修改此属性
|
||||
*/
|
||||
path: string;
|
||||
|
||||
/**
|
||||
* 文件所在的项目的项目路径
|
||||
*/
|
||||
readonly base: string;
|
||||
|
||||
/**
|
||||
* 文件的相对于 base 属性的相对路径
|
||||
*/
|
||||
readonly relative: string;
|
||||
|
||||
|
||||
/**
|
||||
* 文件变更历史,history[0] 即 origin 属性
|
||||
*/
|
||||
readonly history: ReadonlyArray<string>;
|
||||
|
||||
|
||||
/**
|
||||
* 文件所在的文件夹的绝对路径
|
||||
*/
|
||||
readonly dirname: string;
|
||||
|
||||
/**
|
||||
* 文件的文件名
|
||||
*/
|
||||
readonly basename: string;
|
||||
|
||||
|
||||
/**
|
||||
* 文件的扩展名
|
||||
*/
|
||||
readonly extname: string;
|
||||
|
||||
/**
|
||||
* 文件的初始文件名
|
||||
*/
|
||||
readonly origin: string;
|
||||
|
||||
/**
|
||||
* 其他自定义属性
|
||||
*/
|
||||
[customProperty: string]: any;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
declare module 'built-in' {
|
||||
|
||||
/**
|
||||
* 混淆插件参数,设置源代码和目标代码
|
||||
*/
|
||||
type UglifyPluginOption = { sources: string[], target: string };
|
||||
|
||||
type UglifyPluginOptions = UglifyPluginOption[];
|
||||
|
||||
/**
|
||||
* 混淆插件
|
||||
*/
|
||||
export class UglifyPlugin implements plugins.Command {
|
||||
|
||||
constructor(mergeSelector: UglifyPluginOptions);
|
||||
|
||||
}
|
||||
|
||||
|
||||
type LibraryType = "debug" | "release";
|
||||
|
||||
type CompilePluginOptions = { libraryType: LibraryType, defines?: any };
|
||||
/**
|
||||
* 编译命令
|
||||
*/
|
||||
export class CompilePlugin implements plugins.Command {
|
||||
|
||||
constructor(options: CompilePluginOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* EXML 插件,用于发布 EXML 文件
|
||||
*/
|
||||
export class ExmlPlugin implements plugins.Command {
|
||||
|
||||
constructor(publishPolicy: EXML_Publish_Policy);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布策略
|
||||
* * debug : 默认策略,用于开发环境
|
||||
* * contents : 将 EXML 的内容写入到主题文件中
|
||||
* * gjs : 将生成的JS文件写入到主题文件中
|
||||
* * commonjs : 将EXML合并为一个 CommonJS 风格的文件
|
||||
* * commonjs2 : 将EXML合并为一个含有解析方法和皮肤定义的文件,且皮肤抽离为一份配置
|
||||
* * json : 将每个EXML文件生成一份配置
|
||||
*/
|
||||
type EXML_Publish_Policy = "debug" | "contents" | "gjs" | "commonjs" | "commonjs2" | "json"
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 生成 manifest 文件,这个文件会被用于记录 JavaScript 文件的版本号
|
||||
*/
|
||||
export class ManifestPlugin implements plugins.Command {
|
||||
constructor(options?: ManifestPluginOptions)
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成文件的文件名
|
||||
* 支持 json 与 js 两种格式
|
||||
*/
|
||||
type ManifestPluginOptions = {
|
||||
|
||||
output: string,
|
||||
|
||||
hash?: "crc32",
|
||||
|
||||
/**
|
||||
* 是否输出转换过程
|
||||
*/
|
||||
verbose?: boolean,
|
||||
/**
|
||||
* 其他传递的消息参数
|
||||
*/
|
||||
info?:any
|
||||
/**
|
||||
* use wechat engine plugin
|
||||
*/
|
||||
useWxPlugin?: boolean
|
||||
/**
|
||||
* use QQgame engine plugin
|
||||
*/
|
||||
qqPlugin?: { use: boolean, pluginList: string[] }
|
||||
}
|
||||
|
||||
/**
|
||||
* EmitResConfigFilePlugin 的参数
|
||||
* * output: 生成路径,可以指定生成为 *.res.js 文件或者 *.res.json 文件
|
||||
* * typeSelector: 根据文件路径决定文件类型
|
||||
* * nameSelector: 根据文件路径决定文件的资源名
|
||||
* * groupSelector: 根据文件路径决定资源所述的资源组
|
||||
*/
|
||||
type EmitResConfigFilePluginOptions = {
|
||||
output: string,
|
||||
typeSelector: (path: string) => string | null | undefined,
|
||||
nameSelector: (path: string) => string | null | undefined,
|
||||
groupSelector: (path: string) => string | null | undefined,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成 res.json 文件或者 res.js 文件
|
||||
*/
|
||||
export class EmitResConfigFilePlugin implements plugins.Command {
|
||||
|
||||
constructor(options: EmitResConfigFilePluginOptions)
|
||||
|
||||
}
|
||||
|
||||
export type ConvertResourceConfigPluginOption = {
|
||||
|
||||
resourceConfigFiles: { filename: string, root: string }[];
|
||||
|
||||
nameSelector: (url: string) => string;
|
||||
|
||||
TM_Verbose: boolean;
|
||||
}
|
||||
|
||||
export class ConvertResConfigFilePlugin implements plugins.Command {
|
||||
|
||||
constructor(options: ConvertResourceConfigPluginOption);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 增量编译
|
||||
* 这个插件生成的 JavaScript 代码不会被添加到构建管线中,后续其他插件无法获取生成的 js 文件
|
||||
* 这个功能将会在未来被 watch 模式代替掉
|
||||
*/
|
||||
export class IncrementCompilePlugin implements plugins.Command {
|
||||
|
||||
}
|
||||
|
||||
type TextureMergerOptions = {
|
||||
textureMergerRoot: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用 TextureMerger 实现纹理自动合并,依赖 TextureMerger 1.7 以上的版本
|
||||
*/
|
||||
export class TextureMergerPlugin implements plugins.Command {
|
||||
|
||||
constructor(options: TextureMergerOptions);
|
||||
|
||||
}
|
||||
|
||||
type CleanPluginOptions = {
|
||||
|
||||
matchers: string[]
|
||||
}
|
||||
|
||||
|
||||
export class CleanPlugin implements plugins.Command {
|
||||
constructor(options: CleanPluginOptions);
|
||||
}
|
||||
|
||||
|
||||
type RenamePluginOptions = {
|
||||
|
||||
/**
|
||||
* 是否输出日志
|
||||
* Whether to output the log
|
||||
*/
|
||||
verbose?: boolean
|
||||
|
||||
/**
|
||||
* 采用何种 hash 算法,目前暂时只支持 crc32
|
||||
* What hash algorithm is used, currently only crc32 is supported
|
||||
*/
|
||||
hash?: "crc32"
|
||||
|
||||
|
||||
/**
|
||||
* 设置匹配规则,将指定文件进行改名
|
||||
* 该参数是个数组,允许设置多个匹配规则
|
||||
* Set up matching rules to copy specified files to other folders
|
||||
* This parameter is an array that allows multiple matching rules to be set
|
||||
*/
|
||||
matchers: Matcher[]
|
||||
|
||||
/**
|
||||
* 回调函数,返回值里包括文件的一些信息
|
||||
* The callback function, return value includes some information about the file
|
||||
*/
|
||||
callback?: Function
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改文件名插件
|
||||
*/
|
||||
export class RenamePlugin implements plugins.Command {
|
||||
constructor(options: RenamePluginOptions);
|
||||
}
|
||||
|
||||
type ResSplitPluginOptions = {
|
||||
|
||||
/**
|
||||
* 是否输出日志
|
||||
* Whether to output the log
|
||||
*/
|
||||
verbose?: boolean
|
||||
|
||||
/**
|
||||
* 设置匹配规则,将指定文件拷贝至其他文件夹
|
||||
* 该参数是个数组,允许设置多个匹配规则
|
||||
* Set up matching rules to copy specified files to other folders
|
||||
* This parameter is an array that allows multiple matching rules to be set
|
||||
*/
|
||||
matchers: Matcher[]
|
||||
}
|
||||
|
||||
export class ResSplitPlugin implements plugins.Command {
|
||||
constructor(options: ResSplitPluginOptions);
|
||||
}
|
||||
|
||||
|
||||
type ZipPluginOptions = {
|
||||
|
||||
mergeSelector: (p: string) => string
|
||||
}
|
||||
|
||||
export class ZipPlugin implements plugins.Command {
|
||||
|
||||
constructor(option: ZipPluginOptions);
|
||||
}
|
||||
|
||||
type MergeEuiJsonPluginOptions = {
|
||||
|
||||
mergeSelector?: (p: string) => string | null,
|
||||
|
||||
createConfig?: boolean
|
||||
}
|
||||
export class MergeEuiJsonPlugin implements plugins.Command {
|
||||
|
||||
constructor(option?: MergeEuiJsonPluginOptions);
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
export class BaidugamePlugin implements plugins.Command {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
async onFile(file: plugins.File) {
|
||||
if (file.extname == '.js') {
|
||||
const filename = file.origin;
|
||||
if (filename == "libs/modules/promise/promise.js" || filename == 'libs/modules/promise/promise.min.js') {
|
||||
return null;
|
||||
}
|
||||
if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {
|
||||
let content = file.contents.toString();
|
||||
content += `;window.egret = egret;`;
|
||||
content = content.replace(/definition = __global/, "definition = window");
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
else {
|
||||
let content = file.contents.toString();
|
||||
if (
|
||||
filename == "libs/modules/res/res.js" ||
|
||||
filename == 'libs/modules/res/res.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.js'
|
||||
) {
|
||||
content += ";window.RES = RES;"
|
||||
}
|
||||
if (filename == "libs/modules/eui/eui.js" || filename == 'libs/modules/eui/eui.min.js') {
|
||||
content += ";window.eui = eui;"
|
||||
}
|
||||
if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {
|
||||
content += ';window.dragonBones = dragonBones';
|
||||
}
|
||||
content = "var egret = window.egret;" + content;
|
||||
if (filename == 'main.js') {
|
||||
content += "\n;window.Main = Main;"
|
||||
}
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
async onFinish(pluginContext: plugins.CommandContext) {
|
||||
//同步 index.html 配置到 game.js
|
||||
const gameJSPath = path.join(pluginContext.outputDir, "game.js");
|
||||
if(!fs.existsSync(gameJSPath)) {
|
||||
console.log(`${gameJSPath}不存在,请先使用 Launcher 发布百度小游戏`);
|
||||
return;
|
||||
}
|
||||
let gameJSContent = fs.readFileSync(gameJSPath, { encoding: "utf8" });
|
||||
const projectConfig = pluginContext.buildConfig.projectConfig;
|
||||
const optionStr =
|
||||
`entryClassName: ${projectConfig.entryClassName},\n\t\t` +
|
||||
`orientation: ${projectConfig.orientation},\n\t\t` +
|
||||
`frameRate: ${projectConfig.frameRate},\n\t\t` +
|
||||
`scaleMode: ${projectConfig.scaleMode},\n\t\t` +
|
||||
`contentWidth: ${projectConfig.contentWidth},\n\t\t` +
|
||||
`contentHeight: ${projectConfig.contentHeight},\n\t\t` +
|
||||
`showFPS: ${projectConfig.showFPS},\n\t\t` +
|
||||
`fpsStyles: ${projectConfig.fpsStyles},\n\t\t` +
|
||||
`showLog: ${projectConfig.showLog},\n\t\t` +
|
||||
`maxTouches: ${projectConfig.maxTouches},`;
|
||||
const reg = /\/\/----auto option start----[\s\S]*\/\/----auto option end----/;
|
||||
const replaceStr = '\/\/----auto option start----\n\t\t' + optionStr + '\n\t\t\/\/----auto option end----';
|
||||
gameJSContent = gameJSContent.replace(reg, replaceStr);
|
||||
fs.writeFileSync(gameJSPath, gameJSContent);
|
||||
|
||||
//修改横竖屏
|
||||
let orientation;
|
||||
if (projectConfig.orientation == '"landscape"') {
|
||||
orientation = "landscape";
|
||||
}
|
||||
else {
|
||||
orientation = "portrait";
|
||||
}
|
||||
const gameJSONPath = path.join(pluginContext.outputDir, "game.json");
|
||||
let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: "utf8" }));
|
||||
gameJSONContent.deviceOrientation = orientation;
|
||||
fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, "\t"));
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
|
||||
type ManifestConfig = {
|
||||
|
||||
initial: string[],
|
||||
|
||||
game: string[]
|
||||
|
||||
}
|
||||
|
||||
export class BricksPlugin implements plugins.Command {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
async onFile(file: plugins.File) {
|
||||
const filename = file.basename;
|
||||
if (filename == 'manifest.json') {
|
||||
const contents = file.contents.toString();
|
||||
const jsonData: ManifestConfig = JSON.parse(contents);
|
||||
|
||||
let content = '';
|
||||
content += `BK.Script.loadlib("GameRes://js/promise.js");\n`;
|
||||
for (let item of jsonData.initial) {
|
||||
if (item != 'js/promise.js' && item != 'js/promise.min.js') {
|
||||
content += `BK.Script.loadlib("GameRes://${item}");\n`
|
||||
}
|
||||
}
|
||||
for (let item of jsonData.game) {
|
||||
content += `BK.Script.loadlib("GameRes://${item}");\n`
|
||||
}
|
||||
content += `BK.Script.loadlib("GameRes://egret.bricks.js");\n`
|
||||
file.path = file.dirname + '/manifest.js'
|
||||
file.contents = new Buffer(content);
|
||||
} else if (filename == 'main.js') {
|
||||
const content = file.contents.toString();
|
||||
let result = content.replace(/RES\.loadConfig\("resource\/default\.res\.json", "resource\/"\)/gm, 'RES.loadConfig("GameRes://resource/default.res.json", "GameRes://resource/")');
|
||||
result = result.replace(/eui\.Theme\("resource\/default\.thm\.json", _this\.stage\)/gm, 'eui.Theme("GameRes://resource/default.thm.json", _this.stage)');
|
||||
result += ";global.Main = Main;";
|
||||
file.path = file.dirname + '/main.js'
|
||||
file.contents = new Buffer(result);
|
||||
} else if (filename == 'promise.js') {
|
||||
return null;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
async onFinish(pluginContext: plugins.CommandContext) {
|
||||
//同步index.html 配置到main.js
|
||||
let mainJSPath = path.join(pluginContext.outputDir, 'main.js');
|
||||
let mainJSContent = fs.readFileSync(mainJSPath, { encoding: "utf8" });
|
||||
let projectConfig = pluginContext.buildConfig.projectConfig;
|
||||
|
||||
mainJSContent = mainJSContent.replace(/frameRate: 30/gm, `frameRate: ${projectConfig.frameRate}`);
|
||||
mainJSContent = mainJSContent.replace(/contentWidth: 640/gm, `contentWidth: ${projectConfig.contentWidth}`);
|
||||
mainJSContent = mainJSContent.replace(/contentHeight: 1136/gm, `contentHeight: ${projectConfig.contentHeight}`);
|
||||
mainJSContent = mainJSContent.replace(/entryClassName: "Main"/gm, `entryClassName: ${projectConfig.entryClassName}`);
|
||||
mainJSContent = mainJSContent.replace(/scaleMode: "showAll"/gm, `scaleMode: ${projectConfig.scaleMode}`);
|
||||
mainJSContent = mainJSContent.replace(/orientation: "auto"/gm, `orientation: ${projectConfig.orientation}`);
|
||||
fs.writeFileSync(mainJSPath, mainJSContent);
|
||||
}
|
||||
}
|
||||
|
||||
declare var egret;
|
||||
@@ -1,52 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_android/assets/game`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new ManifestPlugin({ output: 'manifest.json' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new UglifyPlugin([{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.json' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,63 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
|
||||
import { BaidugamePlugin } from './baidugame/baidugame';
|
||||
import { CustomPlugin } from './myplugin';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_baidugame`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new BaidugamePlugin(),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new BaidugamePlugin(),
|
||||
new UglifyPlugin([
|
||||
// 使用 EUI 项目,要压缩皮肤文件,可以开启这个压缩配置
|
||||
// {
|
||||
// sources: ["resource/default.thm.js"],
|
||||
// target: "default.thm.min.js"
|
||||
// },
|
||||
{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,55 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
|
||||
import { BricksPlugin } from './bricks/bricks';
|
||||
import { CustomPlugin } from './myplugin';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_bricks/PublicBrickEngineGame/Res`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new ManifestPlugin({ output: 'manifest.json' }),
|
||||
new BricksPlugin()
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
console.log('执行publish')
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new ManifestPlugin({ output: 'manifest.json' }),
|
||||
new UglifyPlugin([{
|
||||
sources: ["main.js"],
|
||||
target: "js/main.min.js"
|
||||
}
|
||||
]),
|
||||
new BricksPlugin(),
|
||||
]
|
||||
}
|
||||
} else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,52 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_ios/assets/game`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new ManifestPlugin({ output: 'manifest.json' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new UglifyPlugin([{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.json' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,63 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
|
||||
import { MygamePlugin } from './mygame/mygame';
|
||||
import { CustomPlugin } from './myplugin';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_mygame`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new MygamePlugin(),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new MygamePlugin(),
|
||||
new UglifyPlugin([
|
||||
// 使用 EUI 项目,要压缩皮肤文件,可以开启这个压缩配置
|
||||
// {
|
||||
// sources: ["resource/default.thm.js"],
|
||||
// target: "default.thm.min.js"
|
||||
// },
|
||||
{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,62 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, ResSplitPlugin, CleanPlugin } from 'built-in';
|
||||
import { OppogamePlugin } from './oppogame/oppogame';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_oppogame`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new OppogamePlugin(),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new OppogamePlugin(),
|
||||
new UglifyPlugin([
|
||||
// 使用 EUI 项目,要压缩皮肤文件,可以开启这个压缩配置
|
||||
// {
|
||||
// sources: ["resource/default.thm.js"],
|
||||
// target: "default.thm.min.js"
|
||||
// },
|
||||
{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,62 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, ResSplitPlugin, CleanPlugin } from 'built-in';
|
||||
import { MiqgamePlugin } from './qgame/qgame';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_qgame`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new MiqgamePlugin(),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new MiqgamePlugin(),
|
||||
new UglifyPlugin([
|
||||
// 使用 EUI 项目,要压缩皮肤文件,可以开启这个压缩配置
|
||||
// {
|
||||
// sources: ["resource/default.thm.js"],
|
||||
// target: "default.thm.min.js"
|
||||
// },
|
||||
{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,65 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
|
||||
import { QQgamePlugin } from './qqgame/qqgame';
|
||||
import { CustomPlugin } from './myplugin';
|
||||
import * as defaultConfig from './config';
|
||||
//是否使用QQ小游戏引擎插件
|
||||
const useQQPlugin: boolean = false;
|
||||
let pluginList: string[] = []
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_qqgame`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new QQgamePlugin(useQQPlugin, pluginList),
|
||||
new ManifestPlugin({ output: 'manifest.js', qqPlugin: { use: useQQPlugin, pluginList: pluginList } })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new QQgamePlugin(useQQPlugin, pluginList),
|
||||
new UglifyPlugin([
|
||||
// 使用 EUI 项目,要压缩皮肤文件,可以开启这个压缩配置
|
||||
// {
|
||||
// sources: ["resource/default.thm.js"],
|
||||
// target: "default.thm.min.js"
|
||||
// },
|
||||
{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.js', qqPlugin: { use: useQQPlugin, pluginList: pluginList } })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,95 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, IncrementCompilePlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, RenamePlugin } from 'built-in';
|
||||
import { WxgamePlugin } from './wxgame/wxgame';
|
||||
import { BricksPlugin } from './bricks/bricks';
|
||||
import { CustomPlugin } from './myplugin';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
|
||||
if (command == 'build') {
|
||||
const outputDir = '.';
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
// new EmitResConfigFilePlugin({
|
||||
// output: "resource/default.res.json",
|
||||
// typeSelector: config.typeSelector,
|
||||
// nameSelector: p => path.basename(p).replace(/\./gi, "_"),
|
||||
// groupSelector: p => "preload"
|
||||
// }),
|
||||
new ExmlPlugin('debug'), // 非 EUI 项目关闭此设置
|
||||
new IncrementCompilePlugin(),
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
const outputDir = `bin-release/web/${version}`;
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CustomPlugin(),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new UglifyPlugin([{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}]),
|
||||
new RenamePlugin({
|
||||
verbose: true, hash: 'crc32', matchers: [
|
||||
{ from: "**/*.js", to: "[path][name]_[hash].[ext]" }
|
||||
]
|
||||
}),
|
||||
new ManifestPlugin({ output: "manifest.json" })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: (path) => {
|
||||
if (path.indexOf("assets/bitmap/") >= 0) {
|
||||
return "assets/bitmap/sheet.sheet"
|
||||
}
|
||||
else if (path.indexOf("armature") >= 0 && path.indexOf(".json") >= 0) {
|
||||
return "assets/armature/1.zip";
|
||||
}
|
||||
},
|
||||
|
||||
typeSelector: (path) => {
|
||||
const ext = path.substr(path.lastIndexOf(".") + 1);
|
||||
const typeMap = {
|
||||
"jpg": "image",
|
||||
"png": "image",
|
||||
"webp": "image",
|
||||
"json": "json",
|
||||
"fnt": "font",
|
||||
"pvr": "pvr",
|
||||
"mp3": "sound",
|
||||
"zip": "zip",
|
||||
"sheet": "sheet",
|
||||
"exml": "text"
|
||||
}
|
||||
let type = typeMap[ext];
|
||||
if (type == "json") {
|
||||
if (path.indexOf("sheet") >= 0) {
|
||||
type = "sheet";
|
||||
} else if (path.indexOf("movieclip") >= 0) {
|
||||
type = "movieclip";
|
||||
};
|
||||
}
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,62 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, ResSplitPlugin, CleanPlugin } from 'built-in';
|
||||
import { VivogamePlugin } from './vivogame/vivogame';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_vivogame/src`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["../engine/js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new VivogamePlugin(),
|
||||
new ManifestPlugin({ output: 'manifest.js', info: { target: 'vivogame' } })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["../engine/js", "resource"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new VivogamePlugin(),
|
||||
new UglifyPlugin([
|
||||
// 使用 EUI 项目,要压缩皮肤文件,可以开启这个压缩配置
|
||||
// {
|
||||
// sources: ["resource/default.thm.js"],
|
||||
// target: "default.thm.min.js"
|
||||
// },
|
||||
{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.js', info: { target: 'vivogame' } })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,65 +0,0 @@
|
||||
/// 阅读 api.d.ts 查看文档
|
||||
///<reference path="api.d.ts"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';
|
||||
import { WxgamePlugin } from './wxgame/wxgame';
|
||||
import { CustomPlugin } from './myplugin';
|
||||
import * as defaultConfig from './config';
|
||||
|
||||
//是否使用微信分离插件
|
||||
const useWxPlugin: boolean = false;
|
||||
const config: ResourceManagerConfig = {
|
||||
|
||||
buildConfig: (params) => {
|
||||
|
||||
const { target, command, projectName, version } = params;
|
||||
const outputDir = `../${projectName}_wxgame`;
|
||||
if (command == 'build') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource", "egret-library"] }),
|
||||
new CompilePlugin({ libraryType: "debug", defines: { DEBUG: true, RELEASE: false } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new WxgamePlugin(useWxPlugin),
|
||||
new ManifestPlugin({ output: 'manifest.js' })
|
||||
]
|
||||
}
|
||||
}
|
||||
else if (command == 'publish') {
|
||||
return {
|
||||
outputDir,
|
||||
commands: [
|
||||
new CleanPlugin({ matchers: ["js", "resource", "egret-library"] }),
|
||||
new CompilePlugin({ libraryType: "release", defines: { DEBUG: false, RELEASE: true } }),
|
||||
new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置
|
||||
new WxgamePlugin(useWxPlugin),
|
||||
new UglifyPlugin([
|
||||
// 使用 EUI 项目,要压缩皮肤文件,可以开启这个压缩配置
|
||||
// {
|
||||
// sources: ["resource/default.thm.js"],
|
||||
// target: "default.thm.min.js"
|
||||
// },
|
||||
{
|
||||
sources: ["main.js"],
|
||||
target: "main.min.js"
|
||||
}
|
||||
]),
|
||||
new ManifestPlugin({ output: 'manifest.js', useWxPlugin: useWxPlugin })
|
||||
]
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw `unknown command : ${params.command}`;
|
||||
}
|
||||
},
|
||||
|
||||
mergeSelector: defaultConfig.mergeSelector,
|
||||
|
||||
typeSelector: defaultConfig.typeSelector
|
||||
}
|
||||
|
||||
|
||||
|
||||
export = config;
|
||||
@@ -1,82 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
export class MygamePlugin implements plugins.Command {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
async onFile(file: plugins.File) {
|
||||
if (file.extname == '.js') {
|
||||
const filename = file.origin;
|
||||
if (filename == "libs/modules/promise/promise.js" || filename == 'libs/modules/promise/promise.min.js') {
|
||||
return null;
|
||||
}
|
||||
if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {
|
||||
let content = file.contents.toString();
|
||||
content += `;window.egret = egret;`;
|
||||
content = content.replace(/definition = __global/, "definition = window");
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
else {
|
||||
let content = file.contents.toString();
|
||||
if (
|
||||
filename == "libs/modules/res/res.js" ||
|
||||
filename == 'libs/modules/res/res.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.js'
|
||||
) {
|
||||
content += ";window.RES = RES;"
|
||||
}
|
||||
if (filename == "libs/modules/eui/eui.js" || filename == 'libs/modules/eui/eui.min.js') {
|
||||
content += ";window.eui = eui;"
|
||||
}
|
||||
if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {
|
||||
content += ';window.dragonBones = dragonBones';
|
||||
}
|
||||
content = "var egret = window.egret;" + content;
|
||||
if (filename == 'main.js') {
|
||||
content += "\n;window.Main = Main;"
|
||||
}
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
async onFinish(pluginContext: plugins.CommandContext) {
|
||||
//同步 index.html 配置到 game.js
|
||||
const gameJSPath = path.join(pluginContext.outputDir, "game.js");
|
||||
if (!fs.existsSync(gameJSPath)) {
|
||||
console.log(`${gameJSPath}不存在,请先使用 Launcher 发布支付宝小游戏`);
|
||||
return;
|
||||
}
|
||||
let gameJSContent = fs.readFileSync(gameJSPath, { encoding: "utf8" });
|
||||
const projectConfig = pluginContext.buildConfig.projectConfig;
|
||||
const optionStr =
|
||||
`entryClassName: ${projectConfig.entryClassName},\n\t\t` +
|
||||
`orientation: ${projectConfig.orientation},\n\t\t` +
|
||||
`frameRate: ${projectConfig.frameRate},\n\t\t` +
|
||||
`scaleMode: ${projectConfig.scaleMode},\n\t\t` +
|
||||
`contentWidth: ${projectConfig.contentWidth},\n\t\t` +
|
||||
`contentHeight: ${projectConfig.contentHeight},\n\t\t` +
|
||||
`showFPS: ${projectConfig.showFPS},\n\t\t` +
|
||||
`fpsStyles: ${projectConfig.fpsStyles},\n\t\t` +
|
||||
`showLog: ${projectConfig.showLog},\n\t\t` +
|
||||
`maxTouches: ${projectConfig.maxTouches},`;
|
||||
const reg = /\/\/----auto option start----[\s\S]*\/\/----auto option end----/;
|
||||
const replaceStr = '\/\/----auto option start----\n\t\t' + optionStr + '\n\t\t\/\/----auto option end----';
|
||||
gameJSContent = gameJSContent.replace(reg, replaceStr);
|
||||
fs.writeFileSync(gameJSPath, gameJSContent);
|
||||
|
||||
//修改横竖屏
|
||||
let orientation;
|
||||
if (projectConfig.orientation == '"landscape"') {
|
||||
orientation = "landscape";
|
||||
}
|
||||
else {
|
||||
orientation = "portrait";
|
||||
}
|
||||
const gameJSONPath = path.join(pluginContext.outputDir, "game.json");
|
||||
let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: "utf8" }));
|
||||
gameJSONContent.deviceOrientation = orientation;
|
||||
fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, "\t"));
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
/**
|
||||
* 示例自定义插件,您可以查阅 http://developer.egret.com/cn/github/egret-docs/Engine2D/projectConfig/cmdExtensionPlugin/index.html
|
||||
* 了解如何开发一个自定义插件
|
||||
*/
|
||||
export class CustomPlugin implements plugins.Command {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
async onFile(file: plugins.File) {
|
||||
return file;
|
||||
}
|
||||
|
||||
async onFinish(commandContext: plugins.CommandContext) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
export class OppogamePlugin implements plugins.Command {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
async onFile(file: plugins.File) {
|
||||
if (file.extname == '.js') {
|
||||
const filename = file.origin;
|
||||
if (filename == "libs/modules/promise/promise.js" || filename == 'libs/modules/promise/promise.min.js') {
|
||||
return null;
|
||||
}
|
||||
if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {
|
||||
let content = file.contents.toString();
|
||||
content += `;window.egret = egret;`;
|
||||
content = content.replace(/definition = __global/, "definition = window");
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
else {
|
||||
let content = file.contents.toString();
|
||||
if (
|
||||
filename == "libs/modules/res/res.js" ||
|
||||
filename == 'libs/modules/res/res.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.js'
|
||||
) {
|
||||
content += ";window.RES = RES;"
|
||||
}
|
||||
if (filename == "libs/modules/eui/eui.js" || filename == 'libs/modules/eui/eui.min.js') {
|
||||
content += ";window.eui = eui;"
|
||||
if(filename == "libs/modules/eui/eui.js"){
|
||||
content = content.replace("function getRepeatedIds","window.getRepeatedIds=function getRepeatedIds");
|
||||
content = content.replace("function getIds","window.getIds=function getIds");
|
||||
content = content.replace("function toXMLString","window.toXMLString=function toXMLString");
|
||||
content = content.replace("function checkDeclarations","window.checkDeclarations=function checkDeclarations");
|
||||
content = content.replace("function getPropertyStr","window.getPropertyStr=function getPropertyStr");
|
||||
}
|
||||
}
|
||||
if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {
|
||||
content += ';window.dragonBones = dragonBones';
|
||||
}
|
||||
content = "var egret = window.egret;" + content;
|
||||
|
||||
if (filename == 'main.js') {
|
||||
content += "\n;window.Main = Main;"
|
||||
}
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
async onFinish(pluginContext: plugins.CommandContext) {
|
||||
//同步 index.html 配置到 game.js
|
||||
const gameJSPath = path.join(pluginContext.outputDir, "main.js");
|
||||
if(!fs.existsSync(gameJSPath)) {
|
||||
console.log(`${gameJSPath}不存在,请先使用 Launcher 发布Oppo快游戏`);
|
||||
return;
|
||||
}
|
||||
let gameJSContent = fs.readFileSync(gameJSPath, { encoding: "utf8" });
|
||||
const projectConfig = pluginContext.buildConfig.projectConfig;
|
||||
const optionStr =
|
||||
`entryClassName: ${projectConfig.entryClassName},\n\t\t` +
|
||||
`orientation: ${projectConfig.orientation},\n\t\t` +
|
||||
`frameRate: ${projectConfig.frameRate},\n\t\t` +
|
||||
`scaleMode: ${projectConfig.scaleMode},\n\t\t` +
|
||||
`contentWidth: ${projectConfig.contentWidth},\n\t\t` +
|
||||
`contentHeight: ${projectConfig.contentHeight},\n\t\t` +
|
||||
`showFPS: ${projectConfig.showFPS},\n\t\t` +
|
||||
`fpsStyles: ${projectConfig.fpsStyles},\n\t\t` +
|
||||
`showLog: ${projectConfig.showLog},\n\t\t` +
|
||||
`maxTouches: ${projectConfig.maxTouches},`;
|
||||
const reg = /\/\/----auto option start----[\s\S]*\/\/----auto option end----/;
|
||||
const replaceStr = '\/\/----auto option start----\n\t\t' + optionStr + '\n\t\t\/\/----auto option end----';
|
||||
gameJSContent = gameJSContent.replace(reg, replaceStr);
|
||||
fs.writeFileSync(gameJSPath, gameJSContent);
|
||||
|
||||
//修改横竖屏
|
||||
let orientation;
|
||||
if (projectConfig.orientation == '"landscape"') {
|
||||
orientation = "landscape";
|
||||
}
|
||||
else {
|
||||
orientation = "portrait";
|
||||
}
|
||||
const gameJSONPath = path.join(pluginContext.outputDir, "manifest.json");
|
||||
let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: "utf8" }));
|
||||
gameJSONContent.orientation = orientation;
|
||||
fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, "\t"));
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
export class MiqgamePlugin implements plugins.Command {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
async onFile(file: plugins.File) {
|
||||
if (file.extname == '.js') {
|
||||
const filename = file.origin;
|
||||
if (filename == "libs/modules/promise/promise.js" || filename == 'libs/modules/promise/promise.min.js') {
|
||||
return null;
|
||||
}
|
||||
if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {
|
||||
let content = file.contents.toString();
|
||||
content += `;window.egret = egret;`;
|
||||
content = content.replace(/definition = __global/, "definition = window");
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
else {
|
||||
let content = file.contents.toString();
|
||||
if (
|
||||
filename == "libs/modules/res/res.js" ||
|
||||
filename == 'libs/modules/res/res.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.js'
|
||||
) {
|
||||
content += ";window.RES = RES;"
|
||||
}
|
||||
if (filename == "libs/modules/eui/eui.js" || filename == 'libs/modules/eui/eui.min.js') {
|
||||
content += ";window.eui = eui;"
|
||||
if(filename == "libs/modules/eui/eui.js"){
|
||||
content = content.replace("function getRepeatedIds","window.getRepeatedIds=function getRepeatedIds");
|
||||
content = content.replace("function getIds","window.getIds=function getIds");
|
||||
content = content.replace("function toXMLString","window.toXMLString=function toXMLString");
|
||||
content = content.replace("function checkDeclarations","window.checkDeclarations=function checkDeclarations");
|
||||
content = content.replace("function getPropertyStr","window.getPropertyStr=function getPropertyStr");
|
||||
}
|
||||
}
|
||||
if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {
|
||||
content += ';window.dragonBones = dragonBones';
|
||||
}
|
||||
content = "var egret = window.egret;" + content;
|
||||
|
||||
if (filename == 'main.js') {
|
||||
content += "\n;window.Main = Main;"
|
||||
}
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
async onFinish(pluginContext: plugins.CommandContext) {
|
||||
//同步 index.html 配置到 game.js
|
||||
const gameJSPath = path.join(pluginContext.outputDir, "main.js");
|
||||
if(!fs.existsSync(gameJSPath)) {
|
||||
console.log(`${gameJSPath}不存在,请先使用 Launcher 发布小米快游戏`);
|
||||
return;
|
||||
}
|
||||
let gameJSContent = fs.readFileSync(gameJSPath, { encoding: "utf8" });
|
||||
const projectConfig = pluginContext.buildConfig.projectConfig;
|
||||
const optionStr =
|
||||
`entryClassName: ${projectConfig.entryClassName},\n\t\t` +
|
||||
`orientation: ${projectConfig.orientation},\n\t\t` +
|
||||
`frameRate: ${projectConfig.frameRate},\n\t\t` +
|
||||
`scaleMode: ${projectConfig.scaleMode},\n\t\t` +
|
||||
`contentWidth: ${projectConfig.contentWidth},\n\t\t` +
|
||||
`contentHeight: ${projectConfig.contentHeight},\n\t\t` +
|
||||
`showFPS: ${projectConfig.showFPS},\n\t\t` +
|
||||
`fpsStyles: ${projectConfig.fpsStyles},\n\t\t` +
|
||||
`showLog: ${projectConfig.showLog},\n\t\t` +
|
||||
`maxTouches: ${projectConfig.maxTouches},`;
|
||||
const reg = /\/\/----auto option start----[\s\S]*\/\/----auto option end----/;
|
||||
const replaceStr = '\/\/----auto option start----\n\t\t' + optionStr + '\n\t\t\/\/----auto option end----';
|
||||
gameJSContent = gameJSContent.replace(reg, replaceStr);
|
||||
fs.writeFileSync(gameJSPath, gameJSContent);
|
||||
|
||||
//修改横竖屏
|
||||
let orientation;
|
||||
if (projectConfig.orientation == '"landscape"') {
|
||||
orientation = "landscape";
|
||||
}
|
||||
else {
|
||||
orientation = "portrait";
|
||||
}
|
||||
const gameJSONPath = path.join(pluginContext.outputDir, "manifest.json");
|
||||
let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: "utf8" }));
|
||||
gameJSONContent.orientation = orientation;
|
||||
fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, "\t"));
|
||||
}
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
export class QQgamePlugin implements plugins.Command {
|
||||
private useQQPlugin: boolean = false;
|
||||
private pliginList: string[] = [];//qq engine plugin
|
||||
constructor(useQQPlugin: boolean, pliginList: string[]) {
|
||||
this.useQQPlugin = useQQPlugin
|
||||
this.pliginList = pliginList
|
||||
}
|
||||
|
||||
async onFile(file: plugins.File) {
|
||||
if (file.extname == '.js') {
|
||||
|
||||
const filename = file.origin;
|
||||
if (filename == "libs/modules/promise/promise.js" || filename == 'libs/modules/promise/promise.min.js') {
|
||||
return null;
|
||||
}
|
||||
if (this.useQQPlugin) {
|
||||
const basename = file.basename
|
||||
//QQ 小游戏引擎插件,支持下列官方库
|
||||
let engineJS = ['assetsmanager', 'dragonBones', 'egret', 'game', 'eui', 'socket', 'tween']
|
||||
for (let i in engineJS) {
|
||||
let jsName = engineJS[i]
|
||||
if (basename == jsName + ".js" || basename == jsName + ".min.js") {
|
||||
this.pliginList.push(`requirePlugin("egret-library/${jsName}.min.js")`);
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {
|
||||
let content = file.contents.toString();
|
||||
content += `;window.egret = egret;`;
|
||||
content = content.replace(/definition = __global/, "definition = window");
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
else {
|
||||
let content = file.contents.toString();
|
||||
if (
|
||||
filename == "libs/modules/res/res.js" ||
|
||||
filename == 'libs/modules/res/res.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.js'
|
||||
) {
|
||||
content += ";window.RES = RES;"
|
||||
}
|
||||
if (filename == "libs/modules/eui/eui.js" || filename == 'libs/modules/eui/eui.min.js') {
|
||||
content += ";window.eui = eui;"
|
||||
}
|
||||
if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {
|
||||
content += ';window.dragonBones = dragonBones';
|
||||
}
|
||||
content = "var egret = window.egret;" + content;
|
||||
if (filename == 'main.js') {
|
||||
content += "\n;window.Main = Main;"
|
||||
}
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
async onFinish(pluginContext: plugins.CommandContext) {
|
||||
let { projectRoot, outputDir, buildConfig } = pluginContext
|
||||
//同步 index.html 配置到 game.js
|
||||
const gameJSPath = path.join(outputDir, "game.js");
|
||||
if (!fs.existsSync(gameJSPath)) {
|
||||
console.log(`${gameJSPath}不存在,请先使用 Launcher 发布QQ小游戏`);
|
||||
return;
|
||||
}
|
||||
let gameJSContent = fs.readFileSync(gameJSPath, { encoding: "utf8" });
|
||||
const projectConfig = buildConfig.projectConfig;
|
||||
const optionStr =
|
||||
`entryClassName: ${projectConfig.entryClassName},\n\t\t` +
|
||||
`orientation: ${projectConfig.orientation},\n\t\t` +
|
||||
`frameRate: ${projectConfig.frameRate},\n\t\t` +
|
||||
`scaleMode: ${projectConfig.scaleMode},\n\t\t` +
|
||||
`contentWidth: ${projectConfig.contentWidth},\n\t\t` +
|
||||
`contentHeight: ${projectConfig.contentHeight},\n\t\t` +
|
||||
`showFPS: ${projectConfig.showFPS},\n\t\t` +
|
||||
`fpsStyles: ${projectConfig.fpsStyles},\n\t\t` +
|
||||
`showLog: ${projectConfig.showLog},\n\t\t` +
|
||||
`maxTouches: ${projectConfig.maxTouches},`;
|
||||
const reg = /\/\/----auto option start----[\s\S]*\/\/----auto option end----/;
|
||||
const replaceStr = '\/\/----auto option start----\n\t\t' + optionStr + '\n\t\t\/\/----auto option end----';
|
||||
gameJSContent = gameJSContent.replace(reg, replaceStr);
|
||||
fs.writeFileSync(gameJSPath, gameJSContent);
|
||||
|
||||
//修改横竖屏
|
||||
let orientation;
|
||||
if (projectConfig.orientation == '"landscape"') {
|
||||
orientation = "landscape";
|
||||
}
|
||||
else {
|
||||
orientation = "portrait";
|
||||
}
|
||||
const gameJSONPath = path.join(outputDir, "game.json");
|
||||
let gameJSONContent = this.readData(gameJSONPath);
|
||||
gameJSONContent.deviceOrientation = orientation;
|
||||
if (!gameJSONContent.plugins) {
|
||||
gameJSONContent.plugins = {}
|
||||
}
|
||||
if (!this.useQQPlugin) {
|
||||
delete gameJSONContent.plugins["egret-library"]
|
||||
} else {
|
||||
let engineVersion = this.readData(path.join(projectRoot, "egretProperties.json")).engineVersion;
|
||||
gameJSONContent.plugins["egret-library"] = {
|
||||
"provider": "1110108620",
|
||||
"version": engineVersion
|
||||
}
|
||||
}
|
||||
this.writeData(gameJSONContent, gameJSONPath)
|
||||
}
|
||||
readData(filePath: string): any {
|
||||
return JSON.parse(fs.readFileSync(filePath, { encoding: "utf8" }));
|
||||
}
|
||||
writeData(data: object, filePath: string) {
|
||||
fs.writeFileSync(filePath, JSON.stringify(data, null, "\t"));
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
|
||||
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
|
||||
"lib": [
|
||||
"es5",
|
||||
"es2015.promise"
|
||||
], /* Specify library files to be included in the compilation: */
|
||||
"allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
// "outDir": "./", /* Redirect output structure to the directory. */
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
// "noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
"noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
/* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
export class VivogamePlugin implements plugins.Command {
|
||||
jsFileList: any = []
|
||||
constructor() {
|
||||
}
|
||||
async onFile(file: plugins.File) {
|
||||
if (file.extname == '.js') {
|
||||
const filename = file.origin;
|
||||
|
||||
if (filename == "libs/modules/promise/promise.js" || filename == 'libs/modules/promise/promise.min.js') {
|
||||
return null;
|
||||
}
|
||||
this.jsFileList.push(file.basename)
|
||||
if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {
|
||||
let content = file.contents.toString();
|
||||
content += `;window.egret = egret;`;
|
||||
content = content.replace(/definition = __global/, "definition = window");
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
else {
|
||||
let content = file.contents.toString();
|
||||
if (
|
||||
filename == "libs/modules/res/res.js" ||
|
||||
filename == 'libs/modules/res/res.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.js'
|
||||
) {
|
||||
content += ";window.RES = RES;"
|
||||
}
|
||||
if (filename == "libs/modules/eui/eui.js" || filename == 'libs/modules/eui/eui.min.js') {
|
||||
content += ";window.eui = eui;"
|
||||
if (filename == "libs/modules/eui/eui.js") {
|
||||
content = content.replace("function getRepeatedIds", "window.getRepeatedIds=function getRepeatedIds");
|
||||
content = content.replace("function getIds", "window.getIds=function getIds");
|
||||
content = content.replace("function toXMLString", "window.toXMLString=function toXMLString");
|
||||
content = content.replace("function checkDeclarations", "window.checkDeclarations=function checkDeclarations");
|
||||
content = content.replace("function getPropertyStr", "window.getPropertyStr=function getPropertyStr");
|
||||
}
|
||||
}
|
||||
if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {
|
||||
content += ';window.dragonBones = dragonBones';
|
||||
}
|
||||
content = "var egret = window.egret;" + content;
|
||||
|
||||
if (filename == 'main.js') {
|
||||
content += "\n;window.Main = Main;"
|
||||
}
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
async onFinish(pluginContext: plugins.CommandContext) {
|
||||
//同步 index.html 配置到 game.js
|
||||
const gameJSPath = path.join(pluginContext.outputDir, "game.js");
|
||||
if (!fs.existsSync(gameJSPath)) {
|
||||
console.log(`${gameJSPath}不存在,请先使用 Launcher 发布 Vivo 小游戏`);
|
||||
return;
|
||||
}
|
||||
let gameJSContent = fs.readFileSync(gameJSPath, { encoding: "utf8" });
|
||||
const projectConfig = pluginContext.buildConfig.projectConfig;
|
||||
const optionStr =
|
||||
`entryClassName: ${projectConfig.entryClassName},\n\t\t` +
|
||||
`orientation: ${projectConfig.orientation},\n\t\t` +
|
||||
`frameRate: ${projectConfig.frameRate},\n\t\t` +
|
||||
`scaleMode: ${projectConfig.scaleMode},\n\t\t` +
|
||||
`contentWidth: ${projectConfig.contentWidth},\n\t\t` +
|
||||
`contentHeight: ${projectConfig.contentHeight},\n\t\t` +
|
||||
`showFPS: ${projectConfig.showFPS},\n\t\t` +
|
||||
`fpsStyles: ${projectConfig.fpsStyles},\n\t\t` +
|
||||
`showLog: ${projectConfig.showLog},\n\t\t` +
|
||||
`maxTouches: ${projectConfig.maxTouches},`;
|
||||
const reg = /\/\/----auto option start----[\s\S]*\/\/----auto option end----/;
|
||||
const replaceStr = '\/\/----auto option start----\n\t\t' + optionStr + '\n\t\t\/\/----auto option end----';
|
||||
gameJSContent = gameJSContent.replace(reg, replaceStr);
|
||||
fs.writeFileSync(gameJSPath, gameJSContent);
|
||||
|
||||
//修改横竖屏
|
||||
let orientation;
|
||||
if (projectConfig.orientation == '"landscape"') {
|
||||
orientation = "landscape";
|
||||
}
|
||||
else {
|
||||
orientation = "portrait";
|
||||
}
|
||||
const gameJSONPath = path.join(pluginContext.outputDir, "manifest.json");
|
||||
let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: "utf8" }));
|
||||
gameJSONContent.deviceOrientation = orientation;
|
||||
let engineVersion = this.readData(path.join(pluginContext.projectRoot, "egretProperties.json")).engineVersion
|
||||
if(!gameJSONContent.thirdEngine)gameJSONContent.thirdEngine={}
|
||||
gameJSONContent.thirdEngine.egret = engineVersion
|
||||
|
||||
fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, "\t"));
|
||||
let isPublish = pluginContext.buildConfig.command == "publish" ? true : false;
|
||||
let configArr: any[] = []
|
||||
for (var i = 0, len = this.jsFileList.length; i < len; i++) {
|
||||
let jsFile = this.jsFileList[i];
|
||||
if (isPublish) {
|
||||
if (jsFile == "main.js") {
|
||||
jsFile = 'main.min.js'
|
||||
} else if (jsFile == "default.thm.js") {
|
||||
jsFile = "default.thm.min.js"
|
||||
}
|
||||
}
|
||||
configArr.push(JSON.stringify({
|
||||
module_name: `./js/${jsFile}`,
|
||||
module_path: `./js/${jsFile}`,
|
||||
module_from: `engine/js/${jsFile}`,
|
||||
}, null, "\t"))
|
||||
}
|
||||
const replaceConfigStr = '\/\/----auto option start----\n\t\t' + configArr.toString() + '\n\t\t\/\/----auto option end----';
|
||||
const minigameConfigPath = path.join(pluginContext.outputDir,"../", "minigame.config.js");
|
||||
if(!fs.existsSync(minigameConfigPath)){
|
||||
//5.2.28版本,vivo更新了项目结构,老项目需要升级
|
||||
fs.writeFileSync(path.join(pluginContext.outputDir,"../","vivo更新了项目结构,请重新创建vivo小游戏项目.js"), "vivo更新了项目结构,请重新创建vivo小游戏项目");
|
||||
}else{
|
||||
let configJSContent = fs.readFileSync(minigameConfigPath, { encoding: "utf8" });
|
||||
configJSContent = configJSContent.replace(reg, replaceConfigStr);
|
||||
fs.writeFileSync(minigameConfigPath, configJSContent);
|
||||
}
|
||||
}
|
||||
readData(filePath: string): any {
|
||||
return JSON.parse(fs.readFileSync(filePath, { encoding: "utf8" }));
|
||||
}
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
const crypto = require('crypto');
|
||||
export class WxgamePlugin implements plugins.Command {
|
||||
private useWxPlugin:boolean = false;
|
||||
constructor(useWxPlugin:boolean) {
|
||||
this.useWxPlugin = useWxPlugin
|
||||
}
|
||||
md5Obj = {}
|
||||
md5(content) {
|
||||
let md5 = crypto.createHash('md5');
|
||||
return md5.update(content).digest('hex');
|
||||
}
|
||||
async onFile(file: plugins.File) {
|
||||
if (file.extname == '.js') {
|
||||
const filename = file.origin;
|
||||
if (filename == "libs/modules/promise/promise.js" || filename == 'libs/modules/promise/promise.min.js') {
|
||||
return null;
|
||||
}
|
||||
if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {
|
||||
let content = file.contents.toString();
|
||||
content += `;window.egret = egret;`;
|
||||
content = content.replace(/definition = __global/, "definition = window");
|
||||
this.md5Obj[path.basename(filename)] = this.md5(content)
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
else {
|
||||
let content = file.contents.toString();
|
||||
if (
|
||||
filename == "libs/modules/res/res.js" ||
|
||||
filename == 'libs/modules/res/res.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||
|
||||
filename == 'libs/modules/assetsmanager/assetsmanager.js'
|
||||
) {
|
||||
content += ";window.RES = RES;"
|
||||
}
|
||||
if (filename == "libs/modules/eui/eui.js" || filename == 'libs/modules/eui/eui.min.js') {
|
||||
content += ";window.eui = eui;"
|
||||
}
|
||||
if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {
|
||||
content += ';window.dragonBones = dragonBones';
|
||||
}
|
||||
content = "var egret = window.egret;" + content;
|
||||
if (filename == 'main.js') {
|
||||
content += "\n;window.Main = Main;"
|
||||
}
|
||||
if (filename == 'libs/long/long.js' || filename == 'libs/long/long.min.js'){
|
||||
content += "window.Long = long;"
|
||||
}
|
||||
this.md5Obj[path.basename(filename)] = this.md5(content)
|
||||
file.contents = new Buffer(content);
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
async onFinish(pluginContext: plugins.CommandContext) {
|
||||
let { projectRoot, outputDir, buildConfig } = pluginContext
|
||||
//同步 index.html 配置到 game.js
|
||||
const gameJSPath = path.join(outputDir, "game.js");
|
||||
if (!fs.existsSync(gameJSPath)) {
|
||||
console.log(`${gameJSPath}不存在,请先使用 Launcher 发布微信小游戏`);
|
||||
return;
|
||||
}
|
||||
let gameJSContent = fs.readFileSync(gameJSPath, { encoding: "utf8" });
|
||||
const projectConfig = buildConfig.projectConfig;
|
||||
const optionStr =
|
||||
`entryClassName: ${projectConfig.entryClassName},\n\t\t` +
|
||||
`orientation: ${projectConfig.orientation},\n\t\t` +
|
||||
`frameRate: ${projectConfig.frameRate},\n\t\t` +
|
||||
`scaleMode: ${projectConfig.scaleMode},\n\t\t` +
|
||||
`contentWidth: ${projectConfig.contentWidth},\n\t\t` +
|
||||
`contentHeight: ${projectConfig.contentHeight},\n\t\t` +
|
||||
`showFPS: ${projectConfig.showFPS},\n\t\t` +
|
||||
`fpsStyles: ${projectConfig.fpsStyles},\n\t\t` +
|
||||
`showLog: ${projectConfig.showLog},\n\t\t` +
|
||||
`maxTouches: ${projectConfig.maxTouches},`;
|
||||
const reg = /\/\/----auto option start----[\s\S]*\/\/----auto option end----/;
|
||||
const replaceStr = '\/\/----auto option start----\n\t\t' + optionStr + '\n\t\t\/\/----auto option end----';
|
||||
gameJSContent = gameJSContent.replace(reg, replaceStr);
|
||||
fs.writeFileSync(gameJSPath, gameJSContent);
|
||||
|
||||
//修改横竖屏
|
||||
let orientation;
|
||||
if (projectConfig.orientation == '"landscape"') {
|
||||
orientation = "landscape";
|
||||
}
|
||||
else {
|
||||
orientation = "portrait";
|
||||
}
|
||||
const gameJSONPath = path.join(outputDir, "game.json");
|
||||
let gameJSONContent = this.readData(gameJSONPath)
|
||||
gameJSONContent.deviceOrientation = orientation;
|
||||
if (buildConfig.command !== "publish" && gameJSONContent.plugins && gameJSONContent.plugins['egret-library']) {
|
||||
delete gameJSONContent.plugins["egret-library"]
|
||||
}
|
||||
this.writeData(gameJSONContent, gameJSONPath)
|
||||
|
||||
//下面的流程是配置开启微信插件的功能
|
||||
let engineVersion = this.readData(path.join(projectRoot, "egretProperties.json")).engineVersion;
|
||||
if (!gameJSONContent.plugins) {
|
||||
gameJSONContent.plugins = {}
|
||||
}
|
||||
if(buildConfig.command == "publish" && this.useWxPlugin){
|
||||
gameJSONContent.plugins["egret-library"] = {
|
||||
"provider": "wx7e2186943221985d",
|
||||
"version": engineVersion,
|
||||
"path": "egret-library"
|
||||
}
|
||||
}else{
|
||||
gameJSONContent.plugins = {}
|
||||
}
|
||||
|
||||
this.writeData(gameJSONContent, gameJSONPath)
|
||||
|
||||
if (buildConfig.command !== "publish" || !this.useWxPlugin) {
|
||||
return
|
||||
}
|
||||
|
||||
let libDir = path.join(outputDir, "egret-library")
|
||||
fs.mkdirSync(libDir)
|
||||
let pluginData = { "main": "index.js" }
|
||||
this.writeData(pluginData, path.join(libDir, "plugin.json"))
|
||||
let engineJS = ['assetsmanager', 'dragonBones', 'egret', 'game', 'eui', 'socket', 'tween']
|
||||
let signatureData: any = {
|
||||
"provider": "wx7e2186943221985d",
|
||||
"signature": []
|
||||
}
|
||||
for (let i in engineJS) {
|
||||
let name = engineJS[i] + '.min.js'
|
||||
if (this.md5Obj[name]) {
|
||||
let jsInfo: any = {
|
||||
"path": name,
|
||||
"md5": this.md5Obj[name]
|
||||
}
|
||||
signatureData.signature.push(jsInfo)
|
||||
}
|
||||
}
|
||||
this.writeData(signatureData, path.join(libDir, "signature.json"))
|
||||
fs.writeFileSync(path.join(libDir, "index.js"), null);
|
||||
|
||||
}
|
||||
|
||||
readData(filePath: string): any {
|
||||
return JSON.parse(fs.readFileSync(filePath, { encoding: "utf8" }));
|
||||
}
|
||||
writeData(data: object, filePath: string) {
|
||||
fs.writeFileSync(filePath, JSON.stringify(data, null, "\t"));
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (c) 2014-present, Egret Technology.
|
||||
// All rights reserved.
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Egret nor the
|
||||
// names of its contributors may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,
|
||||
// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
class AssetAdapter implements eui.IAssetAdapter {
|
||||
/**
|
||||
* @language zh_CN
|
||||
* 解析素材
|
||||
* @param source 待解析的新素材标识符
|
||||
* @param compFunc 解析完成回调函数,示例:callBack(content:any,source:string):void;
|
||||
* @param thisObject callBack的 this 引用
|
||||
*/
|
||||
public getAsset(source: string, compFunc:Function, thisObject: any): void {
|
||||
function onGetRes(data: any): void {
|
||||
compFunc.call(thisObject, data, source);
|
||||
}
|
||||
if (RES.hasRes(source)) {
|
||||
let data = RES.getRes(source);
|
||||
if (data) {
|
||||
onGetRes(data);
|
||||
}
|
||||
else {
|
||||
RES.getResAsync(source, onGetRes, this);
|
||||
}
|
||||
}
|
||||
else {
|
||||
RES.getResByUrl(source, onGetRes, this, RES.ResourceItem.TYPE_IMAGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
module FUI.common {
|
||||
|
||||
export class UI_com_tips extends fairygui.GComponent {
|
||||
public m_content:fairygui.GTextField;
|
||||
public static URL:string = "ui://minsdstak7mf0";
|
||||
|
||||
public static createInstance():UI_com_tips {
|
||||
return <UI_com_tips>(fairygui.UIPackage.createObject("common", "com_tips"));
|
||||
}
|
||||
|
||||
protected constructFromXML(xml:any):void {
|
||||
super.constructFromXML(xml);
|
||||
|
||||
this.m_content = <fairygui.GTextField>(this.getChildAt(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
module FUI.common {
|
||||
|
||||
export class commonBinder {
|
||||
public static bindAll():void {
|
||||
fairygui.UIObjectFactory.setPackageItemExtension(UI_com_tips.URL, UI_com_tips);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
module FUI.loading {
|
||||
|
||||
export class UI_View_loading extends fairygui.GComponent {
|
||||
public m_title:fairygui.GTextField;
|
||||
public m_pg_loading:fairygui.GProgressBar;
|
||||
public static URL:string = "ui://mk2d64e7r5ro0";
|
||||
|
||||
public static createInstance():UI_View_loading {
|
||||
return <UI_View_loading>(fairygui.UIPackage.createObject("loading", "View_loading"));
|
||||
}
|
||||
|
||||
protected constructFromXML(xml:any):void {
|
||||
super.constructFromXML(xml);
|
||||
|
||||
this.m_title = <fairygui.GTextField>(this.getChildAt(1));
|
||||
this.m_pg_loading = <fairygui.GProgressBar>(this.getChildAt(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
module FUI.loading {
|
||||
|
||||
export class loadingBinder {
|
||||
public static bindAll():void {
|
||||
fairygui.UIObjectFactory.setPackageItemExtension(UI_View_loading.URL, UI_View_loading);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
module FUI.sc {
|
||||
|
||||
export class UI_View_sc extends fairygui.GComponent {
|
||||
public m_list_sc:fairygui.GList;
|
||||
public m_combo_transition:fairygui.GComboBox;
|
||||
public static URL:string = "ui://m4sln17ak7mf0";
|
||||
|
||||
public static createInstance():UI_View_sc {
|
||||
return <UI_View_sc>(fairygui.UIPackage.createObject("sc", "View_sc"));
|
||||
}
|
||||
|
||||
protected constructFromXML(xml:any):void {
|
||||
super.constructFromXML(xml);
|
||||
|
||||
this.m_list_sc = <fairygui.GList>(this.getChildAt(0));
|
||||
this.m_combo_transition = <fairygui.GComboBox>(this.getChildAt(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||
|
||||
module FUI.sc {
|
||||
|
||||
export class UI_btn_sc extends fairygui.GButton {
|
||||
public m_name:fairygui.GTextField;
|
||||
public static URL:string = "ui://m4sln17ak7mf2";
|
||||
|
||||
public static createInstance():UI_btn_sc {
|
||||
return <UI_btn_sc>(fairygui.UIPackage.createObject("sc", "btn_sc"));
|
||||
}
|
||||
|
||||
protected constructFromXML(xml:any):void {
|
||||
super.constructFromXML(xml);
|
||||
|
||||
this.m_name = <fairygui.GTextField>(this.getChildAt(3));
|
||||
}
|
||||
}
|
||||
}
|
||||