Compare commits

...

704 Commits

Author SHA1 Message Date
YHH bf14b59a28 空查询应该返回所有实体 2025-10-10 11:49:06 +08:00
YHH 0a0f64510f 更新测试用例 2025-10-10 10:58:52 +08:00
YHH 9445c735c3 对象池内存管理优化 2025-10-10 10:16:44 +08:00
YHH 7339e7ecec 新增scenemanager,重构core类减少多世界造成的性能压力 2025-10-09 23:33:11 +08:00
YHH 79f7c89e23 修复再不同环境下buffer兼容性问题 2025-10-09 17:44:15 +08:00
YHH e724e5a1ba 更新demo 2025-10-09 17:43:46 +08:00
YHH fdaa94a61d v2.1.52 2025-10-09 17:26:07 +08:00
YHH 6af0074c36 导航增加序列化章节 2025-10-09 17:18:14 +08:00
YHH 97a69fed09 增量序列化支持二进制 2025-10-09 17:14:18 +08:00
YHH 959879440d 更新序列化文档 2025-10-09 14:18:43 +08:00
YHH fd1bbb0e00 新增增量序列化 2025-10-09 12:30:04 +08:00
YHH 072e68cf43 修复序列化ci测试 2025-10-08 20:58:07 +08:00
YHH 610232e6b0 core库demo更新 2025-10-08 20:52:31 +08:00
YHH 69c46f32eb 支持二进制序列化 2025-10-08 20:42:55 +08:00
YHH 06b3f92007 场景自定义序列化支持 2025-10-08 18:34:15 +08:00
YHH c631290049 对query/entity进行安全类型扩展 2025-10-08 13:13:23 +08:00
YHH f41c1a3ca3 冗余测试合并 2025-10-08 12:04:13 +08:00
YHH bd6ba84087 Merge pull request #72 from 0MirageTank0/master
优化掩码数据结构,新增BitMaskHashMap类型,支持无限数量原型
2025-10-05 09:13:30 +08:00
MirageTank 1512409eb3 优化位掩码工具的输出格式
- 十六进制不再输出无意义的前导0符号
- 修正部分测试单元检测逻辑
2025-10-04 13:16:51 +08:00
MirageTank bcb5feeb1c 实现高性能 BitMaskHashMap 并优化ArchetypeSystem
- 引入 BitMaskHashMap 类,使用双层 MurmurHash3 哈希算法提升查找性能
- 替换 ArchetypeSystem 中原有的嵌套 Map 结构为 BitMaskHashMap,支持任意数量的原型
- 验证在十万级连续键值下无哈希冲突,确保生产环境可用性
2025-10-04 10:26:19 +08:00
MirageTank da8b7cf601 重构位掩码数据结构,修复部分方法未考虑扩展位的问题
- 所有操作均考虑扩展位、扩展长度不一致的使用场景,无感扩容掩码位
- 使用定长数组存储高低位,遍历友好,为高效哈希计算提供结构支持
- 补充相应单元测试,覆盖所有方法及分支
2025-10-03 16:55:07 +08:00
YHH 316527c459 更新实体文档(components为只读属性) 2025-10-01 00:15:19 +08:00
YHH da70818b22 v2.1.51 2025-10-01 00:11:14 +08:00
YHH 5ea3b72b2b 使用BitMask64Data.segments扩展ComponentRegistry 2025-09-30 23:58:52 +08:00
YHH 632864b361 单一数据源 + 懒加载缓存 2025-09-30 23:37:47 +08:00
YHH 952247def0 重构 Component基类违反ECS纯粹性问题 2025-09-30 22:26:44 +08:00
YHH 51debede52 移除废弃的文件 2025-09-30 20:44:08 +08:00
YHH ce7b731bcf Merge pull request #71 from esengine/fix/issue-70-component-mask-string
Fix/issue 70 component mask string
2025-09-30 18:19:11 +08:00
YHH 86e2dc8fdb 完全删除 ComponentIndexManager 2025-09-30 18:12:49 +08:00
YHH 78047134c2 完全移除 byComponentType 2025-09-30 18:03:03 +08:00
YHH 125a1686ab 完全删除 byComponentType 2025-09-30 17:54:22 +08:00
YHH d542ac48b8 重构byComponentType为lazy cache模式 2025-09-30 17:07:13 +08:00
YHH 1ac0227c90 移除bymask 2025-09-30 17:01:49 +08:00
YHH a5e70bcd99 修复QuerySystem组件掩码索引使用toString()返回[object Object]的问题 #70 2025-09-30 16:38:32 +08:00
YHH 38763de7f6 BitMask64Segment 独立类型 2025-09-30 15:56:28 +08:00
YHH db73b077c5 支持分层 BitMask 自动扩容,避免用户超过组件后报错问题 2025-09-30 15:38:50 +08:00
YHH 0969d09da1 优化ArchetypeSystem的AND指令 2025-09-30 15:08:33 +08:00
YHH a07108a431 修复soa测试用例 2025-09-30 13:43:12 +08:00
YHH 6693b56ab8 Merge pull request #69 from 0MirageTank0/master
优化ArchetypeSystem性能
2025-09-30 13:31:11 +08:00
MirageTank a7349bd360 补充TypeDecorators文件对ComponentType参数类型的修改 2025-09-30 12:53:23 +08:00
MirageTank e92c0040b5 重构原型系统以提升性能
- 将原型ID类型从字符串改为BitMask64Data,避免拼接字符串的性能损耗,降低内存占用.
- 原型ID生成不再依赖组件名称.
2025-09-30 11:57:31 +08:00
MirageTank f448fa48c4 重构组件类型管理器相关函数参数以使用ComponentType,而不是Component. 2025-09-30 11:42:01 +08:00
YHH aa33cad4fa 扩展typedarray存储系统,允许自动类型推断@AutoTyped 2025-09-30 11:00:05 +08:00
YHH d0cb7d5359 v2.1.50 2025-09-30 09:59:46 +08:00
YHH 90153b98fe 更新 2025-09-30 09:51:02 +08:00
YHH 8c4e8d523e 更新微信小游戏worker文档 2025-09-30 09:37:30 +08:00
YHH 90ad4b3ec4 抽象worker接口,避免污染项目 2025-09-29 18:15:47 +08:00
YHH 62bc6b547e 支持wx/browser的worker(由于wx限制默认不开启worker) 2025-09-29 13:21:08 +08:00
YHH be11060674 archetypesystem只负责原型管理,querysytem负责查询和缓存 2025-09-29 11:01:39 +08:00
YHH d62bf9f7f9 entitysytem的logger返回类型更改,需要重写实现getLoggerName 2025-09-29 09:53:13 +08:00
YHH 61fcd52c65 移除eventhandler装饰器 2025-09-29 09:35:02 +08:00
YHH 2947ddeb64 不限制ci的超时时间 2025-09-29 09:04:53 +08:00
YHH d9b752c180 修复workerentitysysten和entitysytem的logger重复问题 2025-09-29 00:01:59 +08:00
YHH b82891caee 装饰器事件自动清理 2025-09-28 23:58:43 +08:00
YHH 05f04ef37e 允许用户自定义核心数量 2025-09-28 23:35:25 +08:00
YHH 66dc9780b9 使用coi-serviceworker用于无法控制标头的情况 2025-09-28 21:11:17 +08:00
YHH d48b22c656 更新demo界面 2025-09-28 21:00:28 +08:00
YHH 727b1864eb 更新demo 2025-09-28 20:49:00 +08:00
YHH de3bfd7551 新增禁用sab功能 2025-09-28 20:41:23 +08:00
YHH dedb91379f worker系统不支持sab回退到普通worker 2025-09-28 20:22:06 +08:00
YHH 1dfcd008aa 新增worker-system文档及源码示例 2025-09-28 20:03:29 +08:00
YHH cf2dc91af6 更新worker-demo 2025-09-28 18:29:32 +08:00
YHH a66f80a766 新增WorkerEntitySystem系统 2025-09-28 17:36:36 +08:00
YHH f4e49c316e getWorldManager允许传入可选配置用于覆盖默认配置 2025-09-28 15:52:46 +08:00
YHH d1cd72bbb2 修复QuerySystem中addEntities没有更新componentIndexManager/archetypeSystem索引 2025-09-28 15:32:54 +08:00
YHH 6178851def 修复QuerySystem/ArchetypeSystem未响应实体增删Component的问题 2025-09-28 15:23:59 +08:00
YHH 945f772c30 只在有package改动的时候触发ci流程 2025-09-28 12:32:35 +08:00
YHH b546c9c712 vitepress修改为githubpage路径 2025-09-28 12:29:43 +08:00
YHH 413ce93b31 更新文档 2025-09-28 12:26:51 +08:00
YHH cffe32911d v2.1.49 2025-09-28 10:36:01 +08:00
YHH 4f651eb42e 优化querysystem系统(减少数组拷贝)
移除dirtytracksystem
2025-09-28 09:40:36 +08:00
YHH 6da1585b6b entitysystem实用帧缓存和长期缓存策略 2025-09-26 18:30:49 +08:00
YHH b988e81a1b 数学库新增Vector3 2025-09-26 17:45:52 +08:00
YHH 1a1c1087d2 标记组件不符合规范的废弃属性 2025-09-26 17:45:26 +08:00
YHH 1a1549230f 更新references库 2025-09-26 13:06:39 +08:00
YHH 64ea53eba1 系统添加缓存实体机制避免频繁开销 2025-09-26 10:50:31 +08:00
YHH 5e052a7e7d 默认不增强事件,避免事件性能开销 2025-09-26 10:28:00 +08:00
YHH cf9ea495d0 移除过时类并标记组件和实体的update为过时方法 2025-09-26 10:09:23 +08:00
YHH 9603c6423b 系统避免在同一帧内进行多次query操作 2025-09-26 09:45:22 +08:00
YHH 457eef585e Merge branch 'master' of https://github.com/esengine/ecs-framework 2025-09-26 09:38:57 +08:00
YHH 1ade449c4d 控制实体update默认不更新 2025-09-26 09:38:51 +08:00
YHH aa9d73a810 Merge pull request #68 from snakenjq/master
场景移除时, 清理系统
2025-09-24 18:25:55 +08:00
SNDA\niujiaqun.nathan cc266a7ba9 修改错误方法调用 2025-09-24 18:18:48 +08:00
SNDA\niujiaqun.nathan d8ea324018 场景移除时, 清理系统 2025-09-24 18:14:22 +08:00
YHH 60566e8d78 v2.1.48 2025-09-24 16:05:22 +08:00
YHH 306d2994dc Merge pull request #67 from foxling/fix/global-log-level
修复 setGlobalLogLevel 不影响新创建 logger 的问题
2025-09-24 15:54:28 +08:00
YHH e6a8791fc3 系统中提供更安全的事件监听器方法(避免内存泄露) 2025-09-24 11:03:37 +08:00
YHH 6cbbc06998 规范jsdoc注释 2025-09-24 10:45:33 +08:00
YHH 0b4244fd8e 修复循环依赖问题 2025-09-24 10:20:36 +08:00
LING YE 367ddfbf8a 修复 setGlobalLogLevel 方法,使其可以在后续新建的 Logger 实例中生效 2025-09-22 15:28:29 +08:00
YHH 168e028098 更新支持es5环境 2025-09-04 16:26:29 +08:00
YHH 042ded37d2 新增自定义log颜色ci测试 2025-09-04 16:25:40 +08:00
YHH 4137eb2bce 网络层完善消息队列 2025-09-04 16:25:18 +08:00
YHH 20a3f03e12 支持用户自定义log颜色 2025-09-04 16:24:38 +08:00
YHH 7792710694 避免splice开销问题,改为SwapPop + typeId → denseIndex 2025-09-03 10:56:33 +08:00
YHH dbddbbdfb8 更新ci测试用例 2025-09-03 10:39:29 +08:00
YHH 4869f5741e bits多态改为POD+原地操作 2025-09-03 10:29:43 +08:00
YHH bda547dd2e 把掩码从BigInt-like多态都改成Mask64 2025-09-03 00:39:00 +08:00
YHH ef80b03a44 更改为固定64位掩码,没必要为任意精度付出性能代价 2025-09-03 00:12:59 +08:00
YHH 6e511ae949 改成 SparseSet+SwapRemove 的致密存储 2025-09-02 22:29:11 +08:00
YHH 94541d0abb 实体中的线性数组换为按组件类型ID直址的稀疏数组 2025-09-02 21:59:59 +08:00
YHH 586a0e5d14 降低ci测试覆盖率 2025-09-02 21:16:36 +08:00
YHH 814842dbaf 降低测试覆盖率导致的ci错误 2025-09-02 21:11:15 +08:00
YHH 70a993573f 修复ci报错 2025-09-02 18:04:55 +08:00
YHH 21659cbb13 交/并/差运算全部改用ID集合单次扫描 2025-09-02 17:17:07 +08:00
YHH a44251cc55 新增world概念(多world管理多scene概念)现在支持多个world多个scene同时更新 2025-08-20 17:48:31 +08:00
YHH 69616bbddc 实现ServerRpc和ClientRpc装饰器 2025-08-20 10:32:56 +08:00
YHH 0a1d7ac083 实现SyncVar装饰器和组件同步 2025-08-20 10:16:54 +08:00
YHH 364bc4cdab update demo 2025-08-20 09:17:43 +08:00
YHH 2504eb24e1 经测试转换为wasm没有明显的效率提升,因为js和rust的交互反而有所下降
等待以后有密集计算再考虑使用,先移除了
2025-08-20 09:15:06 +08:00
YHH bdbef0bd0d core核心rust实现 2025-08-18 20:46:47 +08:00
YHH e4e38ee4e6 更新api文档 2025-08-15 13:47:11 +08:00
YHH 021e892e33 ci流程需要core库先编译后再测试network-shared 2025-08-15 13:32:36 +08:00
YHH c27d5022fd 优化内部组件索引机制(更改为SparseSet索引)减少用户切换索引成本
修复内部系统初始化逻辑 - 不应该再onInitialize中初始内部entities,移动到initialize中
ci跳过cocos项目避免ci失败
soa开放更多安全类型接口
2025-08-15 12:58:55 +08:00
YHH 6730a5d625 传输层实现(客户端/服务端,链接管理和心跳机制,重连机制)
消息序列化(json序列化,消息压缩,消息ID和时间戳)
网络服务器核心(networkserver/基础room/链接状态同步)
网络客户端核心(networkclient/消息队列)
2025-08-14 23:59:00 +08:00
YHH 32092f992d 更新文档 2025-08-14 18:45:24 +08:00
YHH a5f0c8f6b5 更新文档 2025-08-14 18:44:04 +08:00
YHH 85cd93e51a 文档更新 2025-08-14 18:38:09 +08:00
YHH 0b7e623748 新增组件/系统装饰器避免混淆
更改Set兼容web/小游戏
2025-08-14 18:35:03 +08:00
YHH 62f250b43c 重构network库(mvp版本)搭建基础设施和核心接口
定义ITransport/ISerializer/INetworkMessage接口
NetworkIdentity组件
基础事件定义
2025-08-13 13:07:40 +08:00
YHH 25136349ff 修复动态require导致的跨平台错误
新增emitter的dispose方法用于清理事件
启用composite增量编译
2025-08-13 12:18:40 +08:00
YHH baeb047e27 支持可以任意参数 2025-08-12 11:47:18 +08:00
YHH 56dd18b983 废弃core.scene更改为setscene方法 2025-08-12 11:08:27 +08:00
YHH 86cb70a94f Merge branch 'master' of https://github.com/esengine/ecs-framework
# Conflicts:
#	packages/network-shared/package.json
2025-08-12 09:43:29 +08:00
YHH 9f76d37a82 更新network库及core库优化 2025-08-12 09:39:07 +08:00
YHH a026ed9428 降级ws版本 2025-08-11 12:33:42 +08:00
YHH c178e2fbcc 移除ci性能测试,github下不应该测试这些文件 2025-08-11 11:34:38 +08:00
YHH b88bb1dc87 修复ci中的大小写问题
update gitsubmodule
2025-08-11 11:11:56 +08:00
YHH 3069e28224 add submodule electric-world 2025-08-11 11:06:28 +08:00
YHH d69b3af99b 更新math版本 2025-08-11 10:39:14 +08:00
YHH 7398b7c6d0 修复math库tsconfig引用问题 2025-08-11 10:38:11 +08:00
YHH 5d57904d22 更新使用rollup打包
解决大小写冲突问题
2025-08-11 10:34:13 +08:00
YHH 7daf352a25 更新库rollup配置 2025-08-11 10:25:28 +08:00
YHH 6a49f6a534 npm包发布配置更改 2025-08-11 10:03:19 +08:00
YHH 5bce08683a update 2.1.30 2025-08-11 09:31:44 +08:00
YHH edc60fc3d8 添加发布core命令 2025-08-11 09:15:14 +08:00
YHH 1361fd8a90 导出soa装饰器 2025-08-11 09:01:01 +08:00
YHH d539bb3dd9 更新文档 2025-08-11 08:18:18 +08:00
YHH 3b9ae4f384 新增math库 2025-08-10 16:00:02 +08:00
YHH 2783448de5 重新整理网络架构,tsrpc/syncvar并行 2025-08-10 12:35:39 +08:00
YHH 6e21ff08d5 集成tsrpc代替protobuf 2025-08-09 18:56:19 +08:00
YHH e56278e4a6 移除路径映射,只让Jest处理路径解析 2025-08-08 15:57:56 +08:00
YHH fc9bf816dd 修复build失败问题 2025-08-08 15:47:48 +08:00
YHH 854fd7df3a 修复ci测试 2025-08-08 15:41:37 +08:00
YHH 87dd564a12 项目统一改用Logger控制管理
拆分pool类和FluentAPI
2025-08-08 11:16:00 +08:00
YHH 2d389308ea 新增syncvar高级特性,使用protobuf定义 2025-08-07 20:23:49 +08:00
YHH ea8523be35 使用Lerna 和 monorepo管理项目结构 2025-08-07 13:29:12 +08:00
YHH 4479f0fab0 避免throw导致的中止运行,增加fallback回退json的序列化 2025-08-07 10:16:36 +08:00
YHH 7a000318a6 整合组件类型至统一的componentregistry中 2025-08-07 09:43:34 +08:00
YHH 9a08ae74b6 移除json序列化只保留protobuf 2025-08-06 17:42:12 +08:00
YHH f3d2950df3 修复ci失败 2025-08-06 17:12:39 +08:00
YHH 8cfba4a166 新增protobuf依赖(为网络和序列化做准备)
更新readme
2025-08-06 17:04:02 +08:00
YHH 51e6bba2a7 2.1.29 2025-08-06 09:56:55 +08:00
YHH ccbfa78070 修复了QuerySystem在销毁实体时的内存泄漏问题
实现了完整的onAdded/onRemoved回调系统
修复了override修饰符和类型兼容性问题
2025-08-06 09:39:08 +08:00
YHH 69655f1936 测试用例更新 2025-07-31 15:37:40 +08:00
YHH 6ea366cfed 优化matcher内部实现改为querysystem
完善type类型
更新文档
2025-07-31 11:56:04 +08:00
YHH b7d17fb16d soa添加float32 2025-07-30 18:10:14 +08:00
YHH f3dc8c6344 BigIntFactory 缓存优化
- 为 zero() 和 one() 方法添加缓存,避免重复创建对象
ComponentIndexManager 优化
  - 添加了空实体检查,跳过不必要的索引操作
  - 实现了 Set 对象池,重用 Set 实例以减少内存分配
  - 优化了自动优化检查频率,从每次操作变为每100次操作检查一次
EntityManager 优化
  - 对空实体跳过不必要的组件索引、原型系统和脏标记操作
  - 批量创建时同样应用空实体优化
2025-07-30 17:10:58 +08:00
YHH 69ec545854 优化createEntity的性能/新增批量创建实体api 2025-07-30 16:05:16 +08:00
YHH 65386ff731 优化EntitySystem初始化逻辑/防止多次初始化
增加matcher和entitysystem的测试
2025-07-30 15:42:19 +08:00
YHH 01fa33e122 新增soastorage存储器 2025-07-30 14:14:04 +08:00
YHH 0411aa9aef 2.1.28 2025-07-30 11:14:26 +08:00
YHH 4a5c890121 对bigint进行兼容处理(不支持的环境回退到兼容模式) 2025-07-30 11:11:46 +08:00
YHH 4c11fdc176 2.1.27 2025-07-29 16:10:09 +08:00
YHH d99e7a45ea 新增更多覆盖测试 2025-07-29 15:56:40 +08:00
YHH 52528ff1b7 修复querysystem的rebuildindex方法
修复位掩码不一致问题
修复未注册组件的处理
2025-07-29 10:58:31 +08:00
YHH 4a9317f3f4 querysystem进行ci测试隔离 2025-07-29 10:39:48 +08:00
YHH 9450dd5869 修复ci报错 2025-07-29 10:25:12 +08:00
YHH d5471e4828 修复ci报错问题 2025-07-29 09:29:29 +08:00
YHH 2f71785add 覆盖querysystem/eventbus/componentstorage测试 2025-07-29 09:08:31 +08:00
YHH 608f5030b2 对ecs目录进行更多的ci测试 2025-07-28 17:38:18 +08:00
YHH dd8f3714ed 修复不应该jest console导致的ci失败 2025-07-28 17:20:28 +08:00
YHH abec2b3648 querysystem内部框架维护(不需要用户手动调用事件派发)
新增test覆盖测试
2025-07-28 17:14:10 +08:00
YHH ea06a9f07d Merge pull request #58 from esengine/develop_simple_entity
移除过度复杂的组件缓存系统 #57
2025-07-18 21:21:01 +08:00
YHH 9f54759cc5 添加-获取-移除循环CI条件放宽 #57 2025-07-18 18:29:17 +08:00
YHH 55dd5f9ed0 单元测试条件放宽 CI环境性能较低 #57 2025-07-18 18:26:47 +08:00
YHH 05455421fb 移除过度复杂的组件缓存系统 #57 2025-07-18 18:08:57 +08:00
YHH af61067f08 修复ci导致的问题 2025-07-18 15:15:37 +08:00
YHH 19cda88248 移除子模块CI 2025-07-18 15:11:20 +08:00
YHH 0edb2738a1 优化IdentifierPool - 世代式ID池管理器 2025-07-18 14:59:00 +08:00
YHH e1bc364525 新增实用ai编辑器 2025-07-13 22:53:30 +08:00
YHH 2925ee380d 新增mvvm示例 2025-07-08 20:23:19 +08:00
YHH 731edf5872 Merge branch 'master' of https://github.com/esengine/ecs-framework
# Conflicts:
#	.gitmodules
#	extensions/cocos/cocos-ecs/package-lock.json
#	extensions/cocos/cocos-ecs/package.json
2025-07-08 08:57:11 +08:00
YHH 7b85039b17 更新mvvm示例 2025-07-08 08:55:55 +08:00
YHH 2bc45fa574 新增子模块cocos-mvvm 2025-07-07 23:41:53 +08:00
YHH d2b4455205 2.1.26 2025-07-07 11:49:57 +08:00
YHH bce4a26197 构建cjs/mjs 2025-07-07 11:49:36 +08:00
YHH 1da5040d60 打包支持nodejs模块 2025-07-07 11:06:08 +08:00
YHH afd33e053b 更新子模块及导入demo 2025-07-07 11:02:11 +08:00
YHH 171d03c006 新增snapshot快照功能 2025-07-07 09:45:36 +08:00
YHH 34d5237aaa Merge branch 'master' of https://github.com/esengine/ecs-framework
# Conflicts:
#	package-lock.json
#	package.json
2025-07-03 09:02:37 +08:00
YHH 037c3d6a05 2.1.25 2025-07-02 23:49:28 +08:00
YHH 5596ba634e 2.1.24 2025-07-02 23:49:02 +08:00
YHH a5f69065f4 update 2025-07-02 23:48:51 +08:00
YHH 969ef249ea Merge branch 'master' of https://github.com/esengine/ecs-framework 2025-07-02 23:47:41 +08:00
YHH a37183851f 修复queryall缓存信息错误问题 2025-07-02 23:47:30 +08:00
YHH 4cf3e1a769 2.1.24 2025-07-02 11:25:00 +08:00
YHH 354e5a2761 update submodule 2025-07-02 11:23:50 +08:00
YHH c9fd8cc2a7 优化组件递归调用导致的性能问题/新增实体所在的场景显示 2025-07-02 09:42:49 +08:00
YHH bb19f752a1 优化性能结构/延迟加载
新增测试代码用于测试性能
2025-07-02 00:13:29 +08:00
YHH 6bd9c1055c 2.1.23 2025-07-01 11:48:41 +08:00
YHH dff77097c6 git commit 2025-07-01 11:48:26 +08:00
YHH b4dc1c5661 修复type大小写问题 2025-06-30 20:43:11 +08:00
YHH 992338d924 更新性能分析器及更改部分注释 2025-06-30 20:33:45 +08:00
YHH f88a402b0c 新增程序化地形子模块 2025-06-27 16:51:19 +08:00
YHH 5938d36149 版本更新 2025-06-26 18:00:02 +08:00
YHH 78577db3f9 更新示例教程 2025-06-25 23:17:55 +08:00
YHH 0b4a6b77e2 采矿行为树示例 2025-06-25 17:50:40 +08:00
YHH 01084a8897 更新rts示例代码(矿工自动采矿) 2025-06-24 23:51:59 +08:00
YHH 0f18a1979e rts-demo 2025-06-24 19:34:37 +08:00
YHH 68a615bc7b 移除测试代码 2025-06-23 23:48:19 +08:00
YHH add1068c1a Merge branch 'master' of https://github.com/esengine/ecs-framework 2025-06-23 16:08:40 +08:00
YHH 7a40df9965 修复过时文档问题 2025-06-23 16:08:31 +08:00
YHH 3e6a1aa59a 更新example 2025-06-22 21:21:46 +08:00
YHH d3fe79cf39 example update 2025-06-20 18:21:50 +08:00
YHH 48fa547c8f 更改为submodule 2025-06-19 21:04:38 +08:00
YHH 80e2f7df71 remove cocos-extensions 2025-06-19 21:00:42 +08:00
YHH 0107f1f58a remove admin-dashboard 2025-06-19 20:49:09 +08:00
YHH d29c9a96f4 新增热更新后台管理系统 2025-06-19 18:32:32 +08:00
YHH 37d75c3281 2.1.22 2025-06-19 15:43:48 +08:00
YHH 666ded7b89 初始化只在系统真正开始工作时执行 2025-06-19 15:43:22 +08:00
YHH 73a882f75e 2.1.21 2025-06-19 15:01:20 +08:00
YHH 310f5f2349 支持先加入实体后加入系统以让matcher进行实体匹配/优化行为树节点效果及逻辑 2025-06-19 15:00:14 +08:00
YHH 8c86d6b696 更新文档及优化行为树编辑器 2025-06-19 10:38:31 +08:00
YHH 82cd163adc 清理冗余代码及频繁日志输出 2025-06-18 23:37:47 +08:00
YHH 802ee25621 新增Blackboard 2025-06-18 23:31:53 +08:00
YHH f48ebb65ba 修复插件生成代码报错问题 2025-06-18 20:22:17 +08:00
YHH aaa2a8ed2c 新增装饰节点选中功能 2025-06-18 18:31:29 +08:00
YHH 5a06f5420b 条件装饰节点和条件装饰器结合 2025-06-18 18:21:55 +08:00
YHH 343f5a44f2 新增根节点 2025-06-18 15:53:48 +08:00
YHH 92125aee3a 删除连线操作 2025-06-18 15:43:17 +08:00
YHH 96f651b7ca 新增cocos右键打开和保存行为树功能 2025-06-18 15:20:07 +08:00
YHH 06ea01e928 拖拽逻辑更新 2025-06-17 23:59:30 +08:00
YHH 577f1e429a 新增行为树编辑器 2025-06-17 18:28:57 +08:00
YHH 7808f64fe5 更新生成代码工具 2025-06-17 10:46:47 +08:00
YHH e6789e49e4 2.1.20 2025-06-17 07:35:46 +08:00
YHH 797619aece 更新池利用率 2025-06-17 07:35:23 +08:00
YHH 1b5363611d 新增cocos-debug-profiler 2025-06-17 00:32:16 +08:00
YHH 103f773286 添加Cocos Creator ECS编辑器插件:完整的框架管理和模板生成功能 2025-06-16 18:32:44 +08:00
YHH d9ef0b587e 2.1.19 2025-06-16 09:36:59 +08:00
YHH d5b98256f0 优化bits性能及移除组件上限 2025-06-16 09:36:36 +08:00
YHH efcceaa898 2.1.18 2025-06-12 09:47:44 +08:00
YHH e4aad11965 update readme 2025-06-12 09:47:25 +08:00
YHH 47207fad52 2.1.17 2025-06-12 09:44:05 +08:00
YHH 202bf82896 更新场景切换状态 2025-06-12 09:43:57 +08:00
YHH 0e3274a743 移除coreevents事件派发机制 2025-06-12 09:42:35 +08:00
YHH b06174926d 更新快速入门指南 2025-06-10 13:22:28 +08:00
YHH abb23a3c02 2.1.16 2025-06-10 13:12:22 +08:00
YHH 0c8f232282 文档及教程更新 2025-06-10 13:12:14 +08:00
YHH ef023d27bf 2.1.15 2025-06-10 09:50:05 +08:00
YHH 7a591825eb 先移除wasm后续再通过其他方式接入 2025-06-10 09:49:55 +08:00
YHH e71c49d596 移除额外的打包流程 2025-06-09 18:27:20 +08:00
YHH e6ce8995ba 2.1.14 2025-06-09 18:01:34 +08:00
YHH f6250b6d5b 规范为cococs wasm 2025-06-09 18:00:50 +08:00
YHH 757eff2937 2.1.13 2025-06-09 15:55:26 +08:00
YHH 996a7f3ddf 重构WASM架构:移除npm包中的WASM文件,改为独立发布 - 移除自动WASM加载逻辑 - 添加手动initializeWasm API - 创建专门的WASM发布包构建脚本 - 更新Cocos Creator使用指南 2025-06-09 15:54:34 +08:00
YHH 94c050bacb 2.1.12 2025-06-09 15:47:10 +08:00
YHH 3f4aa59a29 完善Cocos Creator支持:添加手动WASM初始化API和使用指南 2025-06-09 15:46:14 +08:00
YHH bee7cf4278 2.1.11 2025-06-09 15:32:11 +08:00
YHH b9db6f0b40 2.1.10 2025-06-09 15:16:31 +08:00
YHH 8967cba3c7 修复WASM路径解析问题,支持Cocos Creator环境 - 改进多路径WASM加载策略 - 添加Core.disableWasm()方法 - 简化WASM初始化逻辑以避免环境兼容性问题 2025-06-09 15:15:41 +08:00
YHH d04ad2eea9 Update build-rollup.js 2025-06-09 14:53:15 +08:00
YHH f2d3880a06 重构项目结构:整理gitignore,移动source目录到根目录,统一依赖管理 2025-06-09 14:51:26 +08:00
YHH ec5f70ecfc fix: 修复npm包构建和发布问题 - 将esbuild target从es2017升级到es2020以支持BigInt - 修复浏览器环境下Node.js模块依赖问题 - 添加define配置处理require等Node.js全局变量 - 成功发布@esengine/ecs-framework@2.1.7到npm 2025-06-09 13:34:46 +08:00
YHH 40b3fe7165 docs: 更新项目文档 - 添加EntityManager、事件系统、性能优化使用示例和说明 2025-06-09 13:25:10 +08:00
YHH 4095f1e946 refactor: 规范化代码注释和更新核心模块 - 移除冗余JSDoc注释,统一代码风格 2025-06-09 13:24:54 +08:00
YHH e219fc47ba feat: 添加ECS核心功能模块 - EntityManager实体管理器、EventBus事件总线、性能优化系统 2025-06-09 13:24:24 +08:00
YHH 6e2e7a4af5 refactor: 拆分WasmCore大文件为模块化结构 - 将23KB的WasmCore.ts拆分为types/loader/fallback/core/instance五个模块 2025-06-09 13:23:46 +08:00
YHH 2e7f764d6c refactor: 细化ECS/Core目录结构 - 按功能拆分为Events/Query/Performance/Storage四个子模块 2025-06-09 13:23:29 +08:00
YHH ce64de5b3d 更改为es2020模块适应Cocos/laya引擎 2025-06-09 10:42:19 +08:00
YHH 35ca1dd7ea 将dist目录添加到.gitignore中 - dist目录是npm包构建的输出目录,不应该提交到版本控制 2025-06-09 10:39:37 +08:00
YHH 8d0ad6b871 新增wasm以优化实体update速度 2025-06-08 21:50:50 +08:00
YHH 0aa4791cf7 更新文档并预留wasm接口 2025-06-08 10:20:51 +08:00
YHH 082c2b46d0 移除数学库 2025-06-07 21:45:11 +08:00
YHH 50420f9052 增加性能测试 2025-06-07 21:28:31 +08:00
YHH 499cbf8a60 Delete node.js.yml 2025-06-07 20:34:55 +08:00
YHH 2e38284d6e 升级项目框架,移除大部分无用的物理和tween系统 2025-06-07 20:32:43 +08:00
YHH 00cc3a11c6 修复安全漏洞 2025-06-07 12:37:16 +08:00
yhh 9909a7f7b0 补全注释 2023-03-14 17:33:05 +08:00
yhh 3363fca160 更改示例及新增注释 2023-03-14 14:03:41 +08:00
yhh 78e0b09c7a 文档更新 2023-03-14 11:22:09 +08:00
yhh caa3ffc8f5 1.新增es.TimeUtils
2.优化并给部分类添加注释
3.移除fasterDictionary
2023-03-13 23:32:24 +08:00
yhh 323fb6a5fe list注释优化 2023-03-13 22:17:11 +08:00
yhh 1adc5f1729 对ECS系统进行注释、移除JobSystem 2023-03-13 17:46:16 +08:00
yhh 78079252c9 修复rectangle中rayinterest方法返回错误信息 2023-03-13 15:23:02 +08:00
yhh 72fdabd099 mathHelper优化及注释。修复pointCircle错误实现 2023-03-13 14:51:38 +08:00
yhh 64bd6aa055 优化mathHelper代码 2023-03-13 12:31:59 +08:00
yhh 6329200b84 升级package包,更新readme 2023-03-13 12:10:17 +08:00
yhh 3f3fd16110 新增扇形collider 2023-02-24 19:16:20 +08:00
YHH 34f0c4ac2d 新增allTweensWithTargetEntity与clearAllCoroutines方法 2022-07-09 11:24:32 +08:00
YHH dde04d514e 新增场景过渡效果 2022-03-12 23:49:14 +08:00
YHH ffddadd798 新增Out类 2022-03-12 10:23:33 +08:00
YHH 5dca337b92 新增MathHelper.toInt 2022-03-12 09:13:06 +08:00
YHH 131df181e6 pool池优化性能 2022-03-07 22:52:51 +08:00
YHH e207952786 性能优化 2022-03-07 16:00:48 +08:00
YHH 3f7ef284fc transform.position更改不需要修改dirty 2022-03-06 18:40:42 +08:00
YHH 1a41533d15 修复mover.motion修正错误问题 2022-03-06 13:56:34 +08:00
YHH 85f7bbbf1a Merge branch 'master' of https://github.com/esengine/ecs-framework
# Conflicts:
#	source/bin/framework.min.js
2022-03-05 10:24:33 +08:00
YHH ccc603b59f 移除渲染模块,提供更纯净的ecs 2022-03-05 10:23:49 +08:00
YHH 8135f99616 防止小游戏函数丢失console.assert 2022-02-24 09:38:07 +08:00
YHH 713f4ae18b Merge branch 'master' of https://github.com/esengine/ecs-framework 2021-10-21 10:09:02 +08:00
YHH f3f5d0bbd1 修复重复多余的定义 2021-10-04 16:53:00 +08:00
YHH 4a9e11c480 更新注释 2021-09-14 18:24:57 +08:00
yhh cd94326aad 新增系统时序控制 2021-08-28 21:26:44 +08:00
yhh a4b971bba0 新增StringUtils.isNullOrEmpty方法 2021-08-26 13:58:09 +08:00
yhh 5d1609111c 补充泛型参数 2021-08-20 19:10:20 +08:00
yhh d54ccaf629 提供component的快捷操作 2021-08-20 19:05:40 +08:00
yhh 6adea240e2 修复componentlist中渲染组件add错误 2021-08-13 19:27:15 +08:00
yhh 3486d403d2 修复ITriggerListener失效问题 2021-08-09 19:08:27 +08:00
yhh f533186c8d listpool根据type划分池 2021-08-06 11:10:45 +08:00
yhh 0beadf8e5a 修复Time不传入dt获取deltaTime错误问题 2021-08-05 11:47:47 +08:00
yhh 8bc06f0476 Merge branch 'master' of https://github.com/esengine/ecs-framework
# Conflicts:
#	extensions/ecs-tween/lib/framework.d.ts
2021-08-04 12:54:18 +08:00
yhh 8fd8f74b27 update physics 2021-08-04 11:28:55 +08:00
yhh 9fc9b60de5 Merge branch 'master' of https://github.com/esengine/ecs-framework into master 2021-08-03 00:13:25 +08:00
yhh 2a026726db 修复tween中start报错 2021-08-03 00:09:43 +08:00
YHH f9a99f8b09 Update physics.md 2021-08-02 09:00:27 +08:00
yhh 95b8dc765d add collision readme 2021-07-27 14:03:57 +08:00
yhh 052d6e25e7 新增emitter与physics文档 2021-07-27 10:05:18 +08:00
yhh fd82486bbc Merge branch 'master' of https://github.com/esengine/ecs-framework into master 2021-07-24 13:48:35 +08:00
yhh ef07f7555f add time/coroutine 使用文档 2021-07-23 14:09:53 +08:00
yhh 67859b7be0 update readme 2021-07-22 10:48:35 +08:00
yhh 1e5ddadd00 Merge branch 'master' of https://github.com/esengine/ecs-framework into master 2021-07-16 07:09:54 +08:00
yhh 7bab76d765 fix 2021-07-16 07:03:14 +08:00
yhh 416f243bda 新增cloth与ragdoll 2021-07-04 23:53:38 +08:00
yhh 77ad112f67 新增tire。修改transform.Component为es.ComponentTransform 2021-07-04 21:03:30 +08:00
yhh dc3d639824 内置tween管理器 2021-07-03 12:27:21 +08:00
yhh 13a001c258 修复verlet报错 2021-07-02 20:59:44 +08:00
yhh 85bdd97d48 新增verlet物理引擎(实验性) 2021-07-02 18:25:30 +08:00
yhh 3d9c8699e7 框架优化 2021-07-02 10:11:09 +08:00
yhh ea482dab48 修复normalized 2021-06-29 18:40:34 +08:00
yhh 96a41eb2cc 移除collider的enable属性 2021-06-22 14:42:30 +08:00
yhh e5dfb20aa2 新增角色控制器 2021-06-22 14:41:21 +08:00
yhh fe308d35f2 完善Color 2021-06-22 13:50:31 +08:00
yhh 219b90fc5d 感谢NEZ库提供的思路 2021-06-11 16:20:01 +08:00
yhh 44e2ca07e5 修复无graphics报错问题 2021-05-28 17:00:33 +08:00
yhh 79d684caae overlapCircle添加检测圆重合 2021-05-28 16:16:58 +08:00
yhh 4db8734a34 添加检查圆重叠的盒子 2021-05-28 16:13:10 +08:00
yhh 8b7baf7f86 新增physics.debugDraw默认绘制 2021-05-28 15:45:45 +08:00
yhh 28145e876f 修复mover返回的collisionResult无数据问题 2021-05-28 15:05:15 +08:00
yhh 53625cf87b 修复mover碰撞失效问题 2021-05-28 14:19:53 +08:00
yhh 88f9779dd0 修复ArcadeRigidbody不触发OnEntityTransform事件 2021-05-28 08:41:38 +08:00
yhh 561a44b26b Merge branch 'master' of https://github.com/esengine/egret-framework 2021-05-27 18:37:17 +08:00
yhh 26068aaf6f 新增渲染接口 2021-05-27 18:32:38 +08:00
YHH fb0f9dc608 Update README.md 2021-05-25 12:10:23 +08:00
yhh 6c44d38c10 对像素进行取整保证在不同分辨率下保持清晰 2021-05-25 11:16:49 +08:00
yhh da3ab02a8d 优化vector2构造函数 2021-05-24 17:20:27 +08:00
yhh 9c7703eb2d 优化框架性能,Time支持传入引擎dt 2021-05-13 16:58:24 +08:00
yhh 84922794fb updateComponent更新 2021-05-12 14:53:29 +08:00
yhh 1dcce99d87 Merge branch 'master' of https://github.com/esengine/egret-framework 2021-05-12 13:09:02 +08:00
yhh fd62aa469a 优化实体更新效率 2021-05-12 13:08:47 +08:00
yhh 63d307b95a 新增identifierPool用于实体id复用 2021-05-11 17:23:04 +08:00
YHH 9f12971eda Update README.md 2021-05-08 10:56:48 +08:00
YHH 47edd4f583 Update README.md 2021-05-08 10:54:22 +08:00
yhh e94b7b23e4 update readme 2021-05-08 10:53:13 +08:00
yhh 5c77e6c56d publish 2021-05-07 16:25:01 +08:00
yhh 522cbe0e6e Merge branch 'master' of https://github.com/esengine/egret-framework
# Conflicts:
#	source/bin/framework.min.js
2021-05-07 16:24:25 +08:00
yhh f7061f360d 移除Bitset更改为Bits 2021-05-07 16:23:15 +08:00
yhh 16cdfa0426 完善mathhelper类与vector2 2021-05-03 08:17:48 +08:00
yhh 74bd0c161f 完善MathHelper/RectangleExt/Vector2Ext 2021-05-02 20:03:56 +08:00
YHH da595e1eb9 Update README.md 2021-04-30 20:55:34 +08:00
yhh 5277c0de7d Time.deltaTime更正
ArcadeRigidbody优化
2021-04-30 20:35:10 +08:00
yhh b3c85e00f9 完善mathHelper类 2021-04-30 15:10:11 +08:00
yhh 0748652a8d 修复getcomponents获取为空问题 2021-04-29 11:00:15 +08:00
yhh 9fa0442b20 shapeCollisions拆分 2021-04-28 14:43:48 +08:00
yhh bc6920f829 优化getComponent与getComponents性能 2021-04-26 15:23:16 +08:00
yhh d576a95548 fix wx 2021-04-23 21:27:34 +08:00
yhh 99eca546d2 remove config 2021-04-21 13:54:10 +08:00
yhh b5d0fc6d0d 优化component add/remove效率 2021-04-20 15:46:18 +08:00
yhh 17b36f01b0 优化实体列表add/remove效率。性能大幅度提高 2021-04-16 17:48:13 +08:00
yhh 5a6d1c72fe Merge branch 'master' of https://github.com/esengine/egret-framework 2021-04-14 17:21:14 +08:00
yhh 030fade7b6 修复bitset问题 2021-04-14 17:17:12 +08:00
YHH 60177d5a8e Update README.md 2021-04-14 10:56:59 +08:00
yhh a28fb72e36 新增 collidesWithAnyNonMotion 2021-04-14 10:51:18 +08:00
yhh 5e15543bab 新增collidesWithAny方法 2021-04-14 10:44:33 +08:00
yhh e1365ed343 新增系统debug使用时间 2021-04-07 15:24:37 +08:00
yhh abb5d10a54 新增getComponentInScene 2021-04-02 19:17:44 +08:00
yhh c58ca510cc 实体获取组件参数补全 2021-04-01 15:48:30 +08:00
yhh 781bad9573 1.新增类型识别
2.EntitySystem新增initialize生命周期,构造函数后执行
2021-03-31 16:59:21 +08:00
yhh 7e94f42b10 修复transform.setparent报错 2021-03-30 18:02:27 +08:00
yhh 0b8d752773 随机类移动至es命名空间 2021-03-29 17:45:36 +08:00
yhh e6096b644f getComponent不再需要指定类型 2021-03-29 17:28:58 +08:00
yhh 6b2c18ad75 更改命名空间linq为es 2021-03-29 15:28:18 +08:00
yhh 8b5bc444f1 场景搜索包含特定组件的实体列表 2021-03-26 17:36:50 +08:00
yhh d2915fe30c 新增 tryGetComponent 方法 2021-03-26 12:53:09 +08:00
yhh b9522ade5d 干掉timerruler 2021-03-26 12:49:00 +08:00
yhh f6513a0cf3 新增jobSystem 2021-02-01 14:23:13 +08:00
yhh d7ec4d087c 优化updateList,性能提高百倍! 2021-02-01 11:11:53 +08:00
yhh 25fca1ed56 新增workerutils 2021-01-29 16:19:00 +08:00
yhh b9822f2270 新增worker辅助类 2021-01-29 16:16:44 +08:00
yhh 11d03cef0c 新增bitVector用于优化bitSet 2021-01-28 11:57:29 +08:00
yhh 1c9276b4a1 新增DelayedIteratingSystem/IntervalSystem/IntervalIteratingSystem 2021-01-27 14:58:51 +08:00
yhh 4f7cfb087a 新增快速开始 README.md 2021-01-26 10:49:25 +08:00
yhh 93768fb4d9 更改注释 2021-01-21 10:18:23 +08:00
yhh f6b6a8aa1b 新增TimeRuler用于分析游戏平均帧率 2021-01-20 15:35:59 +08:00
yhh 1be5862dc4 Merge branch 'master' of https://github.com/esengine/egret-framework 2021-01-19 10:24:36 +08:00
yhh 3e182db019 新增Debug辅助Insist 2021-01-18 19:54:41 +08:00
yhh 8ac1eba378 移除component中的updateInterval 2021-01-18 13:50:48 +08:00
yhh eca9ba7b82 主版本(支持渲染版本移动分支至support_engine) 2021-01-13 13:09:04 +08:00
yhh 6699c32f73 update 2021-01-05 09:41:40 +08:00
yhh cadaeda3bf 初始化适配信息 2021-01-01 18:29:10 +08:00
yhh 62acd38492 Merge branch 'master' of https://github.com/esengine/egret-framework 2020-12-31 16:38:22 +08:00
yhh 01c6c306b1 新增场景策略适配 2020-12-31 16:38:09 +08:00
YHH 1de1b6e05f Update README.md 2020-12-30 17:38:04 +08:00
yhh 6f1fc314b6 新增ecs-tween子模块 2020-12-30 16:38:52 +08:00
yhh d84ffcc2b7 移除Core,新增各接口用于sdk扩展 2020-12-30 16:28:07 +08:00
yhh f934890fac 新增hash 2020-12-28 16:59:16 +08:00
yhh ebc1ab649e 更新collider 2020-12-27 22:23:29 +08:00
yhh 0738e51852 新增Insist断言 2020-12-25 18:04:18 +08:00
yhh 90d84f9316 新增maxRectsBinPack 2020-12-24 11:12:24 +08:00
yhh fa10d5d4d5 新增Coroutine 2020-12-23 17:14:16 +08:00
yhh 8ed3eb24c3 新增Phyisics.overlapRectangle
新增TextureUtils.premultiplyAlpha
新增Entity快速访问Transform内联方法
2020-12-15 11:46:33 +08:00
yhh c60fe13d71 移除fastlist(经测试比Array并没有快) 2020-12-14 11:34:23 +08:00
yhh 59c8d456cb 新增子模块与文件迁移 2020-12-10 16:15:19 +08:00
yhh c0450f21b6 移除注释 2020-12-10 11:19:18 +08:00
yhh 0e7dc67d9d 移除参考依赖 2020-12-10 11:18:56 +08:00
yhh f38b5261d5 新增bezierSpline提供了一系列立方贝塞尔点,并提供了帮助方法来访问贝塞尔 2020-12-10 10:53:05 +08:00
yhh 8230d9cd9b Merge branch 'master' of https://github.com/esengine/egret-framework 2020-12-09 17:57:25 +08:00
yhh 24da0b79c2 修复RealtimeCollisions.intersectMovingCircleBox计算问题 2020-12-09 17:56:48 +08:00
YHH 1c6bb682ea Merge pull request #32 from esengine/imgbot
[ImgBot] Optimize images
2020-12-09 16:58:25 +08:00
YHH 9d2d96c52a Update FUNDING.yml 2020-12-09 11:15:03 +08:00
YHH e455785140 Update FUNDING.yml 2020-12-09 10:58:53 +08:00
YHH dabbe0b6e7 Update FUNDING.yml 2020-12-09 10:58:29 +08:00
ImgBotApp 4c123ed0ec [ImgBot] Optimize images
*Total -- 3,151.12kb -> 2,950.57kb (6.36%)

/sponsor/wechatpay.png -- 130.80kb -> 115.44kb (11.74%)
/sponsor/alipay.jpg -- 234.02kb -> 219.42kb (6.24%)
/screenshot/GIF.gif -- 2,786.30kb -> 2,615.71kb (6.12%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2020-12-09 02:56:09 +00:00
yhh 838795fd34 新增Matrix2D.toMatrix/Matrix类 2020-12-09 10:55:31 +08:00
YHH c398c714a3 Create FUNDING.yml 2020-12-09 10:38:14 +08:00
yhh 8c5e4537a6 新增visiblityComputer 表示从给定的一组遮挡物的原点可以看到哪些区域 2020-12-07 21:01:21 +08:00
yhh 06b2163aaa 优化spatialHash与修复ArcadeRigidbody报错 2020-12-07 14:58:47 +08:00
yhh cf492daa93 修复emitter 2020-12-07 12:16:36 +08:00
yhh bddae046a0 新增arcadeRigidbody组件, 可以用于简单的,街机风格的物理学 2020-12-07 11:48:42 +08:00
yhh 2a0d4ef4dd 移除color 2020-12-06 23:09:03 +08:00
yhh 8b3b645fbb 新增RealtimeCollisions.testCircleBox用于检测园与方框是否重叠并返回point交点 2020-12-04 16:48:33 +08:00
yhh c8096e3334 update gif 2020-12-04 14:55:17 +08:00
yhh 89d1d9c6c3 修复ArrayUtils.randomItem获取undefined 2020-12-04 14:47:11 +08:00
yhh c2cd3b9c44 修复intervalDistance计算错误问题 2020-12-04 14:42:29 +08:00
yhh 9654a4d8c9 修复foreach迭代无法返回问题 2020-12-04 11:57:54 +08:00
yhh 9d0c583399 EntityList.updateList效率提升10倍 2020-12-04 10:54:51 +08:00
yhh c59c822fbf update gif 2020-12-03 20:49:46 +08:00
yhh 2a257ec5b2 Merge branch 'master' of https://github.com/esengine/egret-framework 2020-12-03 20:47:54 +08:00
yhh 8ce6b53cd5 优化碰撞算法 2020-12-03 20:43:59 +08:00
YHH 5ce44651bf Merge pull request #31 from esengine/imgbot
[ImgBot] Optimize images
2020-12-03 05:00:33 -06:00
yhh dac0ef1507 update readme 2020-12-03 18:08:54 +08:00
ImgBotApp 57c39e9091 [ImgBot] Optimize images
/screenshot/GIF.gif -- 2,994.05kb -> 2,556.37kb (14.62%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2020-12-03 10:05:56 +00:00
yhh 4f6d3cb10e update screenshot 2020-12-03 18:05:31 +08:00
yhh 4665d1d0ea 修复因Vector2.add/substract/divide/mutiply导致的计算错误 2020-12-03 17:58:25 +08:00
yhh 89cfd5388f Merge branch 'master' of https://github.com/esengine/egret-framework 2020-12-03 10:26:57 +08:00
yhh f41179965d 修复mover因为set遍历问题 2020-12-03 10:24:30 +08:00
yhh f8f83c52a1 新增gif游戏示例 2020-12-02 22:17:26 +08:00
YHH 83b88039e4 Update README.md 2020-12-02 22:02:32 +08:00
yhh 23a7d8af23 修复matrix2d的identity的获取方法。 2020-12-02 19:56:47 +08:00
yhh b2ebd5ee94 修复entityList获取实体失败问题 2020-12-02 15:42:55 +08:00
yhh f9284e9d8e 修复scenecomponent遍历更新报错 2020-12-01 20:02:45 +08:00
yhh 0d8878abef 移除Graphics相关 2020-11-30 18:23:03 +08:00
yhh 0137309d3a 取消Extension改为linq.List以避免forin污染 2020-11-30 13:50:18 +08:00
yhh 4c329881a1 完善sceneComponent中setEnabled。新增Core.Instance._frameCounter与Core.Instance._totalMemory 2020-11-30 12:57:53 +08:00
YHH 3b4a3fad5a Update README.md 2020-11-30 10:07:41 +08:00
yhh bac1ce5b7a 新增hashSet 2020-11-27 11:07:43 +08:00
yhh 6113fd9986 优化entitylist 2020-11-26 20:02:53 +08:00
yhh ae2cfdafdd 优化triggerListener与ArrayUtils 2020-11-26 17:26:49 +08:00
yhh de3f7bff60 生成dts带注释 2020-11-26 11:48:02 +08:00
yhh 97dfcb4c04 新增entitySystemsEnabled用于控制是否开启系统 2020-11-26 10:44:28 +08:00
yhh 1bb1b8704b 新增 _graphicsDeviceChangeTimer 用于凝聚GraphicsDeviceReset事件 2020-11-26 10:39:32 +08:00
YHH 918d998f4c Update README.md 2020-11-25 11:41:28 +08:00
yhh 24edbdd025 update readme 2020-11-25 11:39:58 +08:00
yhh 015a3b633a 新增time.totalTime 2020-11-25 11:37:24 +08:00
yhh 101d720f2a update readme 2020-11-25 11:12:32 +08:00
yhh 8b76eb3ccc update readme 2020-11-25 11:09:02 +08:00
yhh 1e8d2172bc 更新readme 2020-11-24 19:34:07 +08:00
yhh 8bc367ab48 修复bitset调整数组大小时错误/componentTypeManager获取修复 2020-11-24 18:21:26 +08:00
yhh 73b484d894 修复component关系管理器add问题 2020-11-24 15:27:49 +08:00
yhh 5c0ee92d85 判断接口更改、新增FrameUpdated核心事件 2020-11-24 12:15:20 +08:00
yhh e67f568069 取消wxgame依赖,去除debugRender与camera依赖 2020-11-23 18:10:45 +08:00
yhh 5845128479 移除astar库转为插件 2020-11-23 18:02:14 +08:00
yhh 6505f31ad5 移除物理引擎 2020-11-23 17:47:13 +08:00
yhh 30cc74c8eb update readme 2020-11-23 16:39:14 +08:00
yhh eb0787c198 移除gulp.pipe发布 2020-11-23 16:07:55 +08:00
yhh 0f17aff8fd 移除demo 2020-11-23 16:07:30 +08:00
yhh 14a73e4010 移除所有egret 依赖。移除renderablecomponent及所有依赖,移除camera。保持ecs基础框架 2020-11-23 16:05:06 +08:00
yhh 0fd6a24f5a 移除tiled依赖,改为可选 https://github.com/esengine/egret-framework-tiled 2020-11-20 16:30:09 +08:00
yhh 7eab688d9c 新增doc 2020-11-20 14:07:34 +08:00
yhh 562bacbe22 使用zIndex代替swapChildIndex 2020-11-18 14:56:08 +08:00
yhh 8b423310a6 Merge branch 'master' of https://github.com/esengine/egret-framework
# Conflicts:
#	demo/libs/framework/framework.min.js
2020-11-03 10:10:03 +08:00
yhh 7268ebab4a goap sample 2020-11-02 11:06:22 +08:00
yhh 8191359953 修复因fastlist component丢失问题 2020-10-30 20:08:26 +08:00
yhh c9fc9ffea5 新增agent用于帮助快速使用goap 2020-10-29 17:29:38 +08:00
yhh 1a78dada61 新增AI-GOAP目标导向计划与ASTAR寻路配合使用 2020-10-29 11:22:01 +08:00
yhh 85cc4b4ecc Merge branch 'master' of https://github.com/esengine/egret-framework 2020-10-27 18:09:00 +08:00
yhh fc6a8a0803 新增fastList、注释完善 2020-10-27 18:08:49 +08:00
YHH 3d8cdaf46c Update README.md 2020-10-19 13:17:31 +08:00
yhh 0e7b0bc45c 取消entitylist双缓冲区 使用分帧优化大数量实体时卡顿问题 2020-10-09 16:59:34 +08:00
yhh 74fcfd7778 优化updatelist增快addEntity速度 2020-10-09 15:39:06 +08:00
yhh c9c745c730 新增prototypespriteRenderer 2020-09-30 18:31:58 +08:00
yhh dd994cb16d timerRuler 新增调试渲染
timerRuler 提示为中文
2020-09-29 18:26:05 +08:00
yhh 861ef3db31 修复默认origin没有赋值正确问题 2020-09-16 20:16:51 +08:00
yhh f33bac012a update README 2020-09-16 18:17:42 +08:00
yhh 4294632909 update readme 2020-09-16 18:13:37 +08:00
yhh 449ca74e44 update readme 2020-09-16 17:44:11 +08:00
yhh 52980f0b55 新增scene.optimizeCost参数 用于优化cost过高情况 2020-09-16 14:48:15 +08:00
yhh 8e97dcda9c 动态合批 2020-09-15 09:39:26 +08:00
yhh 4ce810bdcd 修复demo 空格项目无法运行问题 2020-09-14 17:59:03 +08:00
yhh 24a463b85b 优化寻路速度 2020-09-14 17:54:17 +08:00
yhh 700d0194be 新增staticSpriteContainerRenderer 2020-09-14 13:32:20 +08:00
yhh 34a8d48df9 Coroutine 类型从IEnumerable为Iterator 2020-09-01 11:51:03 +08:00
YHH 8db028db1c 准备新增verlet物理引擎 2020-08-31 09:28:53 +08:00
yhh 358e899e8b 新增 CoroutineManager 协同程序 2020-08-28 19:12:21 +08:00
yhh 7a308f76b6 debugRender 新增camera参数来修正渲染位置 2020-08-28 18:04:50 +08:00
YHH a3c53116e1 修复碰撞器旋转后bounds计算错误 2020-08-28 09:13:53 +08:00
yhh d07912d610 新增虚拟输入类 VirtualInput 2020-08-27 18:48:20 +08:00
yhh e81f98ff17 修复Vector2.zero引起的引用混乱问题 2020-08-26 19:56:48 +08:00
yhh 1997b3f348 timeruler 绘制 2020-08-25 19:04:12 +08:00
yhh 0ab0728ddf update readme 2020-08-25 17:42:03 +08:00
yhh 46a8de39e3 新增windTransition例子 2020-08-25 17:28:22 +08:00
yhh 794e33a0a0 修复tiledmap tmxDirectory不正确问题 2020-08-25 16:19:56 +08:00
yhh 0bb09f6442 Merge branch 'master' of https://github.com/esengine/egret-framework 2020-08-25 14:21:46 +08:00
yhh 27dea50026 新增Ref类型 2020-08-25 14:21:37 +08:00
YHH a39677062c Merge pull request #30 from esengine/imgbot
[ImgBot] Optimize images
2020-08-24 17:28:04 +08:00
YHH 27f9e78fe5 为boxCollider与spriteRenderer新增debugRender 2020-08-24 09:06:25 +08:00
ImgBotApp fc0a46d6a8 [ImgBot] Optimize images
*Total -- 30.71kb -> 8.13kb (73.53%)

/demo/resource/characters/1.png -- 4.86kb -> 1.18kb (75.76%)
/demo/resource/characters/5.png -- 5.14kb -> 1.28kb (75.09%)
/demo/resource/characters/6.png -- 4.88kb -> 1.25kb (74.41%)
/demo/resource/characters/2.png -- 5.17kb -> 1.41kb (72.79%)
/demo/resource/characters/4.png -- 5.34kb -> 1.51kb (71.74%)
/demo/resource/characters/3.png -- 5.32kb -> 1.51kb (71.69%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2020-08-23 14:10:25 +00:00
YHH 7345a17d24 新增ninja adventure例子 2020-08-23 22:09:22 +08:00
YHH 6c1cfec928 新增Physics.linecast/linecastAll方法 2020-08-22 12:21:40 +08:00
YHH 73f0f54ba7 Merge pull request #29 from esengine/imgbot
[ImgBot] Optimize images
2020-08-22 00:05:29 +08:00
ImgBotApp 24705d24f1 [ImgBot] Optimize images
*Total -- 162.77kb -> 109.27kb (32.87%)

/demo/resource/preload/orange.png -- 25.79kb -> 5.85kb (77.32%)
/demo/resource/preload/bg.png -- 7.88kb -> 2.81kb (64.37%)
/demo/resource/preload/moon.png -- 1.34kb -> 0.75kb (43.88%)
/demo/resource/preload/orangeNorm.png -- 60.69kb -> 45.92kb (24.32%)
/demo/resource/preload/bgNorm.png -- 28.49kb -> 22.06kb (22.59%)
/demo/resource/assets/buch-outdoor.png -- 16.16kb -> 12.65kb (21.74%)
/demo/resource/preload/moonNorm.png -- 22.42kb -> 19.24kb (14.21%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2020-08-21 11:22:17 +00:00
yhh 646d1806ec demo 更新 2020-08-21 19:21:40 +08:00
yhh 6d4d787530 修复tiled中objectgroup塞image解析失败问题 2020-08-18 17:39:11 +08:00
yhh 66ef4c6597 tmxDirectory 2020-08-17 19:40:44 +08:00
YHH f7ee2c8d1c tiled 防止中断合批 2020-08-15 22:29:45 +08:00
YHH b3961d8ea1 Merge branch 'master' of https://github.com/esengine/egret-framework 2020-08-15 22:25:22 +08:00
YHH 1a2dd9ff2a tiled 文本位置居中 2020-08-15 22:24:08 +08:00
YHH 21e33495d8 Merge pull request #27 from esengine/develop_tiled
tiled 支持
2020-08-15 22:01:37 +08:00
YHH 23a45bfd2d Merge remote-tracking branch 'remotes/origin/master' into develop_tiled
# Conflicts:
#	demo/libs/framework/framework.min.js
#	source/bin/framework.min.js
2020-08-15 22:00:43 +08:00
YHH 593cc83012 #28 tiled objectgroup解析 2020-08-15 21:59:52 +08:00
YHH f0b2d5b9b8 #28 支持objectgroup的tile类型 2020-08-15 18:16:59 +08:00
YHH 5dc7a72310 #28 tiled orthogonal支持 2020-08-15 12:16:23 +08:00
yhh 89d05726ac #18 动态图集用于优化drawcall 2020-08-14 15:46:19 +08:00
yhh 15f6b06348 #28 修复解析properties 2020-08-14 11:44:20 +08:00
YHH a2a73562a0 #28 tileset 渲染 2020-08-14 08:54:27 +08:00
YHH 9111b69cee #28 parselayers方法修改 2020-08-13 22:23:02 +08:00
yhh 4290a10d5d #28 解析layers 2020-08-13 20:32:36 +08:00
yhh b0511db001 #28 tiled 数据解析与渲染 2020-08-13 17:39:24 +08:00
yhh 4012a9f6d1 新增场景截图 requestScreenshot 2020-08-12 19:57:06 +08:00
yhh e5805960e0 #28 新增tiledMapRenderer用于渲染tiledmap 2020-08-12 18:08:12 +08:00
yhh 167ef03df6 tiled 基本数据 2020-08-12 12:16:35 +08:00
yhh c89ed25d8a update readme 2020-08-11 14:20:39 +08:00
yhh 4baaa2629d Merge branch 'master' of https://github.com/esengine/egret-framework
# Conflicts:
#	README.md
2020-08-11 11:08:27 +08:00
yhh a3dbff63f0 新增相机震动、场景组件 2020-08-11 11:07:20 +08:00
YHH c6ef018d5e Update Reademe 2020-08-10 14:14:20 +08:00
YHH 14b70b307c camera.mapSize 支持左上顶点更改 2020-08-08 15:09:10 +08:00
YHH a39b98b5d9 #23 修复绘制层级问题 2020-08-08 14:43:43 +08:00
YHH 3492bbdf5e 修复scrollingSprite无法向左移动问题 2020-08-08 14:11:25 +08:00
YHH 7d0bcbcb32 demo fix 2020-08-08 10:18:56 +08:00
YHH c02a3aa071 Merge branch 'master' of https://github.com/esengine/egret-framework 2020-08-08 10:12:43 +08:00
YHH a105bb11ca 修复origin导致显示位置错误问题 2020-08-08 10:12:08 +08:00
YHH 3fbbba7ac2 Merge pull request #25 from esengine/develop
#16 新增createEntityAsync方法
2020-08-08 09:51:24 +08:00
YHH 7cd38ea54e #16 新增createEntityAsync方法
修复entity.id为null
2020-08-08 09:50:40 +08:00
YHH 42852c5dba Merge pull request #24 from esengine/develop
#23 组件绘制层支持
2020-08-08 09:44:05 +08:00
YHH 6a3622a5ef #23 组件绘制层支持 2020-08-08 09:43:03 +08:00
YHH 03b568e28d Merge pull request #22 from esengine/develop
#21 新增gapXY用于平铺/滚动间距
2020-08-08 09:07:35 +08:00
YHH e7fb9e0d6b #21 完善 gapxy 2020-08-08 09:06:32 +08:00
yhh 463c64c628 #21 新增gapXY用于平铺/滚动间距 2020-08-07 15:34:42 +08:00
YHH 4025bc8554 Merge pull request #20 from esengine/develop
实现精灵平铺效果
2020-08-07 11:03:05 +08:00
yhh 1bf822725a #19 滚动精灵支持 2020-08-07 11:02:04 +08:00
YHH 359d7ae223 实现 scrollingSprite 2020-08-07 09:21:55 +08:00
YHH c611e31f7e Merge branch 'master' into develop
# Conflicts:
#	demo/libs/framework/framework.min.js
#	demo/src/game/MainScene.ts
#	source/bin/framework.min.js
2020-08-07 08:51:19 +08:00
YHH 834ad565e1 #19 实现精灵平铺效果 2020-08-07 08:50:26 +08:00
yhh ab3f38c6a8 修复lockUtils在wx上报错问题 2020-08-06 12:01:20 +08:00
yhh d0199e357b 修复vector2 y=0赋值错误问题 2020-08-06 10:55:02 +08:00
yhh 8e3bcc1257 射线检测完善 2020-08-03 14:45:57 +08:00
YHH a4fe9f5798 Merge pull request #15 from esengine/develop_ray
射线检测
2020-08-03 14:08:30 +08:00
yhh c692f0157e 新增射线检测 2020-08-03 14:06:47 +08:00
yhh bc6626865e ray2d 2020-07-31 19:33:04 +08:00
yhh 40fe7a57db 新增raycast射线 2020-07-31 17:17:44 +08:00
yhh 514572f291 reformat code 2020-07-28 16:25:20 +08:00
yhh 5994f0bee3 Merge branch 'master' of https://github.com/esengine/egret-framework 2020-07-28 16:12:31 +08:00
yhh b3e1f2c446 边框支持旋转 2020-07-28 16:11:58 +08:00
YHH ed13186779 Merge pull request #13 from esengine/develop_collider
整理ecs框架
2020-07-28 11:08:46 +08:00
yhh d730851d97 修复circleToBox检测偏差问题 2020-07-27 18:16:19 +08:00
yhh 60921f703b #12 fix addObserver函数异常错误 2020-07-27 17:27:32 +08:00
yhh 506f8ddc0f 新增renderablecomponent显示
优化返回值
2020-07-27 16:10:36 +08:00
YHH 149a3e5833 修复tostring导致的循环maxinum call 2020-07-26 23:27:42 +08:00
yhh 2b13e5ee7d 初始化默认数值 2020-07-24 16:57:26 +08:00
yhh 6be43fc9ac 优化transform结构
新增实体列表排序
2020-07-24 15:29:07 +08:00
yhh d4c244daf5 修复运行时未初始化 2020-07-23 19:28:01 +08:00
yhh 79c5d6990c SceneManager更改为Core继承egret.DisplayContainer 2020-07-23 15:39:18 +08:00
yhh 347626a8ea 忽略ide缓存 2020-07-23 13:26:52 +08:00
yhh e61dd0c16b 优化matrix 2020-07-23 13:25:10 +08:00
yhh 1b52bc5fd1 全部移动至es模块 2020-07-23 11:00:46 +08:00
YHH 814234ca61 移动类至es模块 2020-07-23 09:10:27 +08:00
YHH 15c0844e29 移动部分类模块至es
优化框架
2020-07-22 23:30:31 +08:00
yhh 5b8f414a45 整理ecs框架 2020-07-22 20:07:14 +08:00
yhh 6b8569b0b5 collider更改 2020-07-20 16:38:49 +08:00
yhh 2a38858838 提供对SpriteAnimator中的一些字段的访问 2020-07-20 13:46:58 +08:00
yhh e76d5815f2 1. 修正了相机在变焦时不能保持在目标中心的问题
2. 增加检查,以确保碰撞器被触发时enabled也开启
2020-07-20 13:44:26 +08:00
yhh dccd4e21b6 base64辅助类 2020-07-17 15:40:28 +08:00
yhh c96e8b3a04 新增Time/String/Array/Keyboard/Random/Object/Texture辅助类 2020-07-17 14:34:42 +08:00
YHH e686ba64d7 Update README.md 2020-07-17 11:55:29 +08:00
yhh 14cb9cd257 贝塞尔曲线 2020-07-17 11:07:57 +08:00
yhh 13e7737cb9 防止删除一个空的函数发生未定义报错 2020-07-15 10:56:06 +08:00
yhh dd65c60921 Merge branch 'master' of https://github.com/esengine/egret-framework 2020-07-15 10:53:38 +08:00
yhh 7dffb4d94a #12 fix Emitter类移除监听时是否有错 2020-07-15 10:53:30 +08:00
YHH 476204a296 Update README.md 2020-07-13 17:13:53 +08:00
yhh 983c8fbc99 iupdatable无法判断接口 去除改为component支持 2020-07-13 12:48:42 +08:00
YHH c30e591f6e Update README.md 2020-07-13 10:56:25 +08:00
YHH d9a1b5578c Update README.md 2020-07-13 10:56:06 +08:00
YHH f0e04b6981 emitter 支持 context 2020-07-12 23:41:10 +08:00
YHH 14598f08c7 sceneChanged事件 2020-07-12 23:30:48 +08:00
YHH 032b293085 新增analysis用于分析游戏缺陷 2020-07-12 14:51:20 +08:00
YHH d9bb76c105 Merge branch 'master' of https://github.com/esengine/egret-framework
# Conflicts:
#	demo/libs/framework/framework.d.ts
#	demo/libs/framework/framework.min.js
#	demo/src/game/MainScene.ts
#	source/bin/framework.d.ts
#	source/bin/framework.min.js
2020-07-12 09:46:07 +08:00
YHH 20392c8ab6 Set theme jekyll-theme-slate 2020-07-10 12:19:47 +08:00
yhh 583e03d025 Merge branch 'develop' 2020-07-10 11:25:11 +08:00
yhh f6c2d81a83 新增IUpdatable接口 用于减少update所带来的的性能损耗 2020-07-10 11:24:42 +08:00
YHH e703ff4e6c Merge pull request #11 from esengine/develop
Develop
2020-07-09 16:37:13 +08:00
yhh 877fc4c9bf astar 注释 2020-07-09 16:36:42 +08:00
yhh a80bb4b6f3 绘制帮助类 2020-07-09 16:16:04 +08:00
YHH 9b9d210109 Merge pull request #10 from esengine/develop
新增 circleCollider与 polygonCollider
2020-07-09 15:13:58 +08:00
yhh 817b703d4f 新增 circleCollider与 polygonCollider 2020-07-09 15:11:30 +08:00
YHH 88a25453e6 Merge pull request #9 from esengine/develop
对boxcollider碰撞支持
2020-07-09 14:16:52 +08:00
yhh 6e3eb1189a 修复boxcollider碰撞问题 2020-07-09 14:16:10 +08:00
YHH 1e3b2763e8 Merge branch 'develop' of https://github.com/esengine/egret-framework into develop 2020-07-08 22:00:39 +08:00
YHH a3dacd04f0 Merge branch 'master' into develop
# Conflicts:
#	demo/libs/framework/framework.min.js
#	demo/src/game/MainScene.ts
#	source/bin/framework.min.js
2020-07-08 21:56:07 +08:00
yhh aea50926a9 优化spriteRenderer渲染方法 2020-07-08 18:12:17 +08:00
yhh 299c1b8e7d 修复切换场景未移除问题 2020-07-08 15:15:15 +08:00
YHH 3f6ab79894 滚动精灵 2020-07-07 21:40:57 +08:00
yhh b14fee1685 box重载overlaps 2020-07-07 18:54:19 +08:00
yhh ace8fb685d box 重载 collidesWith 2020-07-07 12:18:51 +08:00
YHH 1870ee5e45 Merge pull request #8 from esengine/develop
Develop
2020-07-03 17:53:08 +08:00
yhh 8be65fa685 update reademe 2020-07-03 17:52:26 +08:00
yhh cf4e76b12d 新增tiledspriterenderer 2020-07-03 17:51:18 +08:00
YHH c156463f10 Merge pull request #7 from esengine/develop
新增动画 移除不相关的库
2020-07-03 16:48:34 +08:00
yhh e7796550c6 移除资源 2020-07-03 16:47:24 +08:00
yhh c3c9181400 新增动画 移除不相关的库 2020-07-03 16:45:52 +08:00
YHH 4f4d508685 Merge pull request #6 from esengine/develop
移除 transform
2020-07-01 16:56:45 +08:00
yhh f36a1cdb27 移除 transform 2020-07-01 16:55:10 +08:00
YHH 28941f2395 Merge pull request #4 from esengine/develop
新增被动系统与协调系统 完善matcher
2020-07-01 15:16:23 +08:00
YHH 7f02272304 Merge pull request #5 from esengine/restyled/develop
Restyle 新增被动系统与协调系统 完善matcher
2020-07-01 15:11:39 +08:00
Restyled.io 02d86e7b0a Restyled by prettier 2020-07-01 06:57:39 +00:00
Restyled.io 4c8b6add98 Restyled by clang-format 2020-07-01 06:57:33 +00:00
yhh 60d646c392 移除restylers 2020-07-01 14:57:09 +08:00
yhh 5e871bc501 新增被动系统与协调系统 完善matcher 2020-07-01 14:54:35 +08:00
yhh 549db2fcfe 新增restylers 2020-07-01 14:35:49 +08:00
yhh d9840d60ef 合并camera 2020-07-01 14:19:40 +08:00
yhh 124cf3f66c code quality 2020-06-30 23:44:52 +08:00
yhh cd78b8de59 Merge branch 'master' of https://github.com/esengine/egret-framework 2020-06-30 23:24:10 +08:00
yhh a3209de000 移除stale 2020-06-30 23:23:25 +08:00
YHH 2908be1705 Create SECURITY.md 2020-06-30 23:22:25 +08:00
YHH 009a01ebf4 Merge pull request #3 from esengine/imgbot
[ImgBot] Optimize images
2020-06-30 23:13:18 +08:00
yhh 3fdbf3bfef 新增stale 2020-06-30 23:10:48 +08:00
ImgBotApp c8ecf3cc69 [ImgBot] Optimize images
*Total -- 168.02kb -> 149.53kb (11.01%)

/demo/resource/assets/Panel/border.png -- 1.02kb -> 0.33kb (67.59%)
/demo/resource/assets/Slider/track.png -- 0.91kb -> 0.30kb (67.52%)
/demo/resource/assets/Panel/header.png -- 0.92kb -> 0.31kb (66.52%)
/demo/resource/assets/ItemRenderer/selected.png -- 0.92kb -> 0.31kb (66.52%)
/demo/resource/assets/ScrollBar/roundthumb.png -- 0.91kb -> 0.31kb (66.45%)
/demo/resource/assets/Slider/tracklight.png -- 0.91kb -> 0.31kb (66.45%)
/demo/resource/assets/CheckBox/checkbox_unselect.png -- 0.98kb -> 0.33kb (66.37%)
/demo/resource/assets/RadioButton/radiobutton_unselect.png -- 1.29kb -> 0.45kb (65.43%)
/demo/resource/assets/CheckBox/checkbox_select_disabled.png -- 1.22kb -> 0.43kb (64.91%)
/demo/resource/assets/ProgressBar/track_pb.png -- 0.95kb -> 0.34kb (64.02%)
/demo/resource/assets/ProgressBar/thumb_pb.png -- 0.95kb -> 0.35kb (63.01%)
/demo/resource/assets/ToggleSwitch/handle.png -- 1.13kb -> 0.43kb (61.49%)
/demo/resource/assets/RadioButton/radiobutton_select_up.png -- 1.42kb -> 0.56kb (60.95%)
/demo/resource/assets/Slider/thumb.png -- 1.23kb -> 0.49kb (60.1%)
/demo/resource/assets/ToggleSwitch/off.png -- 1.24kb -> 0.52kb (58.01%)
/demo/resource/assets/ToggleSwitch/on.png -- 1.25kb -> 0.52kb (57.96%)
/demo/resource/assets/CheckBox/checkbox_select_up.png -- 1.23kb -> 0.53kb (57.23%)
/demo/resource/assets/Button/button_up.png -- 1.00kb -> 0.43kb (57.02%)
/demo/resource/assets/CheckBox/checkbox_select_down.png -- 1.21kb -> 0.52kb (56.96%)
/demo/resource/assets/Button/button_down.png -- 1.02kb -> 0.45kb (56.45%)
/demo/resource/assets/RadioButton/radiobutton_select_down.png -- 1.65kb -> 0.79kb (51.81%)
/demo/resource/assets/RadioButton/radiobutton_select_disabled.png -- 1.65kb -> 0.79kb (51.81%)
/demo/resource/assets/egret_icon.png -- 6.62kb -> 4.20kb (36.61%)
/demo/resource/assets/bg.jpg -- 136.40kb -> 135.55kb (0.62%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2020-06-30 15:08:49 +00:00
yhh 088891c5ca 新增poolcomponent 对象池组件 2020-06-30 22:22:52 +08:00
yhh 099aa749e1 async scenetransition 2020-06-30 21:42:51 +08:00
yhh db7aac2b90 修复场景切换未在临界点切换问题 2020-06-30 14:32:29 +08:00
yhh 366bcf8efc mvc 2020-06-30 11:36:29 +08:00
yhh a4f1ae351f ecs适配egret 2020-06-29 15:41:02 +08:00
YHH a63d8598d8 shader 2020-06-28 08:38:22 +08:00
yhh d7385654ef gaussianblur 特效 2020-06-23 17:36:39 +08:00
yhh 7399b9f5ca 修复transition层级问题 2020-06-23 16:18:14 +08:00
YHH 795bfab1aa 新增postProcessor用于处理屏幕特效 2020-06-23 09:10:40 +08:00
yhh fb5906afe0 新增windtransition 2020-06-22 19:37:10 +08:00
YHH e38cd0f3ca Merge pull request #2 from esengine/develop_scenetransition
新增sceneTransition 用于场景过渡
2020-06-22 15:28:45 +08:00
yhh 481112cfc2 完善渐隐场景转换 2020-06-22 15:27:58 +08:00
YHH 3d9730d956 新增sceneTransition 用于场景过渡 2020-06-21 10:27:15 +08:00
YHH 60646edd6b 新增input类 用于管理触摸点信息 2020-06-19 22:43:56 +08:00
yhh 9bd5a99c81 修复isvisibleFromCamera剔除错误 新增setcolor方法 2020-06-19 19:28:14 +08:00
yhh d22c5775c2 新增Sprite用于控制纹理 2020-06-19 18:16:42 +08:00
YHH 981e149ca5 新增跟随相机 2020-06-19 09:16:49 +08:00
YHH b83b1a5b21 修复stage的宽高错误 2020-06-19 08:32:35 +08:00
YHH 09e6ace142 更新相机强制刷新矩阵 2020-06-19 00:38:37 +08:00
YHH e83bb087ea 相机渲染 2020-06-18 23:22:54 +08:00
yhh feaac83ee7 新增renderer渲染器 用于控制场景如何渲染 2020-06-18 16:35:51 +08:00
yhh 915056203d 新增全局管理器 2020-06-18 12:14:06 +08:00
yhh 231276e39b 新增renderable组件render方法 去除mathhelper.minof/maxof 2020-06-18 10:49:32 +08:00
yhh 9c293979a4 v1.0.1 2020-06-18 10:07:08 +08:00
YHH bc995e36c2 修复 triggerlistener 发生碰撞后不断触发问题(仅第一次碰撞触发) 2020-06-18 09:06:59 +08:00
YHH 18279d16cd 修复 collsionTriggerHelper 遍历问题 2020-06-18 00:03:01 +08:00
YHH 59b2f150f3 新增Long库 移除原有Long.ts 2020-06-17 23:19:25 +08:00
YHH e6d6c4199f fix long 2020-06-17 22:40:49 +08:00
yhh ccf8c4e107 新增 Long 类型 2020-06-17 20:40:56 +08:00
yhh 9e6e5eccc8 新增numberdictionary的散列键 2020-06-16 20:22:22 +08:00
yhh 447ea4efe4 修复box因缺少初始化报错问题 2020-06-16 16:35:17 +08:00
yhh 7f5b78f340 新增gulp build 2020-06-16 13:27:06 +08:00
YHH 4ac8bafa87 Merge pull request #1 from esengine/develop-test-ci
Create node.js.yml
2020-06-16 13:19:06 +08:00
yhh 25ce4c9cf9 remove test 2020-06-16 13:16:58 +08:00
yhh 2b81a0b06b Merge branch 'master' into develop-test-ci 2020-06-16 13:14:37 +08:00
yhh e68f6bd1be packages 2020-06-16 13:13:55 +08:00
YHH 06c1aeb97a Create node.js.yml 2020-06-16 12:46:40 +08:00
yhh ced176706b 修复physics register失效问题 2020-06-16 11:59:40 +08:00
yhh 8b21edc65f 新增mover移动器组件 用于处理itriggerListener接口碰撞信息 2020-06-16 11:22:37 +08:00
YHH 75301f7776 完善 colliderTriggerHelper 用于更新碰撞信息 2020-06-16 09:10:09 +08:00
YHH dba43b9773 完善shapeCollision 支持多边形 2020-06-16 00:04:28 +08:00
yhh 5186bc0187 修复polygon数组错误 修复emit空注册报错 2020-06-15 20:08:21 +08:00
yhh c3120d791f 新增事件发送接收器 2020-06-15 12:16:23 +08:00
yhh 16892eb7af 移除物理引擎 移动到新库 2020-06-15 10:42:06 +08:00
YHH 7f8f1cf0d0 优化collision 2020-06-15 08:46:38 +08:00
yhh 246e9a9511 新增shapecollision 用于计算多边形碰撞 2020-06-12 20:24:51 +08:00
YHH da5a1a0c79 优化Flags 2020-06-12 08:56:10 +08:00
YHH 6fa56dd572 新增flag 帮助处理位掩码 2020-06-12 08:47:13 +08:00
yhh ad68f0e1a0 新增shape形状 2020-06-11 20:36:36 +08:00
yhh 53ded30e0b 优化圆和矩形碰撞检测 2020-06-11 10:06:29 +08:00
YHH 2eec9a82f9 新增box复合体 修复vector2运算问题 2020-06-11 00:03:26 +08:00
yhh 74cbb4c9fd 新增verletworld 2020-06-10 20:29:16 +08:00
yhh fa4c3c5d0b 新增相机bounds与可渲染组件bounds 并添加可渲染组件的剔除方法 2020-06-10 17:41:53 +08:00
yhh f62f449d99 新增renderableComponent 用于控制可渲染组件的基类 不要在transform当中直接更改目标属性 2020-06-10 16:25:39 +08:00
yhh 94818d5784 新增webgl帮助类 用于自定义绘图 2020-06-10 13:38:04 +08:00
yhh 5f7c13c8cd 新增breadthfirst与dijkstra寻路算法 2020-06-10 12:23:19 +08:00
YHH 538677575d 新增polygonmesh 2020-06-10 08:57:17 +08:00
YHH 1816b16924 readme 更新 2020-06-09 23:14:47 +08:00
537 changed files with 118814 additions and 146727 deletions
+4
View File
@@ -0,0 +1,4 @@
{
"toolchains": [],
"backend.maxHeapSizeMb": 896
}
+12
View File
@@ -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']
+84
View File
@@ -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
+67
View File
@@ -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
+71 -2
View File
@@ -1,2 +1,71 @@
/source/node_modules
/demo/bin-debug
# 依赖目录
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/
+33
View File
@@ -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
+40
View File
@@ -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
+2
View File
@@ -0,0 +1,2 @@
examples/*/settings/**
extensions/*/settings/**
+123 -7
View File
@@ -1,11 +1,127 @@
# egret-framework
用于egret 包含众多高性能方法以供使用
(正在施工中)
# ECS Framework
## 计划列表
[![CI](https://github.com/esengine/ecs-framework/workflows/CI/badge.svg)](https://github.com/esengine/ecs-framework/actions)
[![npm version](https://badge.fury.io/js/%40esengine%2Fecs-framework.svg)](https://badge.fury.io/js/%40esengine%2Fecs-framework)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-3178C6?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GitHub stars](https://img.shields.io/github/stars/esengine/ecs-framework?style=social)](https://github.com/esengine/ecs-framework/stargazers)
- [ ] 包含一套适配egret的ecs框架
一个高性能的 TypeScript ECS (Entity-Component-System) 框架,专为现代游戏开发而设计。
- [ ] 高性能物理引擎
## 特性
> 尽可能的简单易用
- **高性能** - 针对大规模实体优化,支持SoA存储和批量处理
- **多线程计算** - Worker系统支持真正的并行处理,充分利用多核CPU性能
- **类型安全** - 完整的TypeScript支持,编译时类型检查
- **现代架构** - 支持多World、多Scene的分层架构设计
- **开发友好** - 内置调试工具和性能监控
- **跨平台** - 支持Cocos Creator、Laya引擎和Web平台
## 安装
```bash
npm install @esengine/ecs-framework
```
## 快速开始
```typescript
import { Core, Scene, Component, EntitySystem, ECSComponent, ECSSystem, Matcher, Time } from '@esengine/ecs-framework';
// 定义组件
@ECSComponent('Position')
class Position extends Component {
constructor(public x = 0, public y = 0) {
super();
}
}
@ECSComponent('Velocity')
class Velocity extends Component {
constructor(public dx = 0, public dy = 0) {
super();
}
}
// 创建系统
@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** - 浏览器环境直接运行
- **小游戏平台** - 微信、支付宝等小游戏
## 示例项目
- [Worker系统演示](https://esengine.github.io/ecs-framework/demos/worker-system/) - 多线程物理系统演示,展示高性能并行计算
- [割草机演示](https://github.com/esengine/lawn-mower-demo) - 完整的游戏示例
## 文档
- [快速入门](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 文档
## 生态系统
- [路径寻找](https://github.com/esengine/ecs-astar) - A*、BFS、Dijkstra 算法
- [AI 系统](https://github.com/esengine/BehaviourTree-ai) - 行为树、效用 AI
## 社区与支持
- [问题反馈](https://github.com/esengine/ecs-framework/issues) - Bug 报告和功能建议
- [QQ 交流群](https://jq.qq.com/?_wv=1027&k=29w1Nud6) - ecs游戏框架交流
## 许可证
[MIT](LICENSE) © 2025 ECS Framework
+53
View File
@@ -0,0 +1,53 @@
# 安全政策
## 支持的版本
我们为以下版本提供安全更新:
| 版本 | 支持状态 |
| ------- | ------------------ |
| 2.0.x | :white_check_mark: |
| 1.0.x | :x: |
## 报告漏洞
如果您发现了安全漏洞,请通过以下方式报告:
### 报告渠道
- **邮箱**: [安全邮箱将在实际部署时提供]
- **GitHub**: 创建私有安全报告(推荐)
### 报告流程
1. **不要**在公开的 issue 中报告安全漏洞
2. 提供详细的漏洞描述,包括:
- 受影响的版本
- 复现步骤
- 潜在的影响范围
- 如果可能,提供修复建议
### 响应时间
- **确认收到**: 72小时内
- **初步评估**: 1周内
- **修复发布**: 根据严重程度,通常在2-4周内
### 处理流程
1. 我们会确认漏洞的存在和严重程度
2. 开发修复方案并进行测试
3. 发布安全更新
4. 在修复发布后,会在相关渠道公布漏洞详情
### 安全最佳实践
使用 ECS Framework 时,请遵循以下安全建议:
- 始终使用最新的稳定版本
- 定期更新依赖项
- 在生产环境中禁用调试模式
- 验证所有外部输入数据
- 不要在客户端存储敏感信息
感谢您帮助保持 ECS Framework 的安全性!
-29
View File
@@ -1,29 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Wing Player",
"type": "chrome",
"request": "launch",
"file": "index.html",
"runtimeExecutable": "${execPath}",
"useBuildInServer": true,
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"preLaunchTask":"build",
"port":5479
},
{
"name": "Launch Chrome",
"type": "chrome",
"request": "launch",
"file": "index.html",
"useBuildInServer": true,
"sourceMaps": true,
"webRoot": "${workspaceRoot}",
"preLaunchTask":"build",
"userDataDir":"${tmpdir}",
"port":5479
}
]
}
-6
View File
@@ -1,6 +0,0 @@
{
"search.exclude": {
"**/bin-debug": true,
"**/bin-release": true
}
}
-34
View File
@@ -1,34 +0,0 @@
{
"version": "0.1.0",
"command": "egret",
"isShellCommand": true,
"suppressTaskName": true,
"tasks": [
{
"taskName": "build",
"showOutput": "always",
"args": [
"build",
"-sourcemap"
],
"problemMatcher": "$tsc"
},
{
"taskName": "clean",
"showOutput": "always",
"args": [
"build",
"-e"
],
"problemMatcher": "$tsc"
},
{
"taskName": "publish",
"showOutput": "always",
"args": [
"publish"
],
"problemMatcher": "$tsc"
}
]
}
-32
View File
@@ -1,32 +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": "framework",
"path": "./libs/framework"
}
]
}
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

-95
View File
@@ -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="30"
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>
-52
View File
@@ -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{
}
}
-413
View File
@@ -1,413 +0,0 @@
declare interface Array<T> {
findIndex(predicate: Function): number;
any(predicate: Function): boolean;
firstOrDefault(predicate: Function): T;
find(predicate: Function): T;
where(predicate: Function): Array<T>;
count(predicate: Function): number;
findAll(predicate: Function): Array<T>;
contains(value: any): boolean;
removeAll(predicate: Function): void;
remove(element: any): boolean;
removeAt(index: any): void;
removeRange(index: any, count: any): void;
select(selector: Function): Array<T>;
orderBy(keySelector: Function, comparer: Function): Array<T>;
orderByDescending(keySelector: Function, comparer: Function): Array<T>;
groupBy(keySelector: Function): Array<T>;
sum(selector: any): any;
}
declare class PriorityQueueNode {
priority: number;
insertionIndex: number;
queueIndex: number;
}
declare class AStarPathfinder {
static search<T>(graph: IAstarGraph<T>, start: T, goal: T): T[];
private static hasKey;
private static getKey;
static recontructPath<T>(cameFrom: Map<T, T>, start: T, goal: T): T[];
}
declare class AStarNode<T> extends PriorityQueueNode {
data: T;
constructor(data: T);
}
declare class AstarGridGraph implements IAstarGraph<Point> {
dirs: Point[];
walls: Point[];
weightedNodes: Point[];
defaultWeight: number;
weightedNodeWeight: number;
private _width;
private _height;
private _neighbors;
constructor(width: number, height: number);
isNodeInBounds(node: Point): boolean;
isNodePassable(node: Point): boolean;
search(start: Point, goal: Point): Point[];
getNeighbors(node: Point): Point[];
cost(from: Point, to: Point): number;
heuristic(node: Point, goal: Point): number;
}
interface IAstarGraph<T> {
getNeighbors(node: T): Array<T>;
cost(from: T, to: T): number;
heuristic(node: T, goal: T): any;
}
declare class PriorityQueue<T extends PriorityQueueNode> {
private _numNodes;
private _nodes;
private _numNodesEverEnqueued;
constructor(maxNodes: number);
clear(): void;
readonly count: number;
contains(node: T): boolean;
enqueue(node: T, priority: number): void;
dequeue(): T;
remove(node: T): void;
isValidQueue(): boolean;
private onNodeUpdated;
private cascadeDown;
private cascadeUp;
private swap;
private hasHigherPriority;
}
declare abstract class Component {
entity: Entity;
displayRender: egret.DisplayObject;
private _enabled;
updateInterval: number;
readonly transform: Transform;
enabled: boolean;
setEnabled(isEnabled: boolean): this;
abstract initialize(): any;
onAddedToEntity(): void;
onRemovedFromEntity(): void;
onEnabled(): void;
onDisabled(): void;
onEntityTransformChanged(comp: ComponentTransform): void;
update(): void;
bind(displayRender: egret.DisplayObject): this;
registerComponent(): void;
deregisterComponent(): void;
}
declare class Entity {
name: string;
scene: Scene;
readonly transform: Transform;
readonly components: ComponentList;
private _updateOrder;
private _enabled;
private _isDestoryed;
componentBits: BitSet;
parent: Transform;
position: Vector2;
localPosition: Vector2;
rotation: number;
rotationDegrees: number;
localRotation: number;
localRotationDegrees: number;
scale: Vector2;
localScale: Vector2;
readonly worldInverseTransform: Matrix2D;
readonly localToWorldTransform: Matrix2D;
readonly worldToLocalTransform: Matrix2D;
readonly isDestoryed: boolean;
enabled: boolean;
setEnabled(isEnabled: boolean): this;
constructor(name: string);
updateOrder: number;
setUpdateOrder(updateOrder: number): this;
attachToScene(newScene: Scene): void;
detachFromScene(): void;
addComponent<T extends Component>(component: T): T;
hasComponent<T extends Component>(type: any): boolean;
getOrCreateComponent<T extends Component>(type: T): T;
getComponent<T extends Component>(type: any): T;
removeComponentForType<T extends Component>(type: any): boolean;
removeComponent(component: Component): void;
removeAllComponents(): void;
update(): void;
onAddedToScene(): void;
onRemovedFromScene(): void;
onTransformChanged(comp: ComponentTransform): void;
destory(): void;
}
declare class Scene extends egret.DisplayObjectContainer {
camera: Camera;
readonly entities: EntityList;
private _projectionMatrix;
private _transformMatrix;
private _matrixTransformMatrix;
readonly entityProcessors: EntityProcessorList;
constructor(displayObject: egret.DisplayObject);
createEntity(name: string): Entity;
addEntity(entity: Entity): Entity;
destroyAllEntities(): void;
findEntity(name: string): Entity;
addEntityProcessor(processor: EntitySystem): EntitySystem;
removeEntityProcessor(processor: EntitySystem): void;
getEntityProcessor<T extends EntitySystem>(): T;
setActive(): Scene;
initialize(): void;
onActive(): void;
onDeactive(): void;
update(): void;
prepRenderState(): void;
destory(): void;
}
declare class SceneManager {
private static _loadedScenes;
private static _lastScene;
private static _activeScene;
static createScene(name: string, scene: Scene): Scene;
static setActiveScene(scene: Scene): Scene;
static getActiveScene(): Scene;
}
declare enum DirtyType {
clean = 0,
positionDirty = 1,
scaleDirty = 2,
rotationDirty = 3
}
declare enum ComponentTransform {
position = 0,
scale = 1,
rotation = 2
}
declare class Transform {
readonly entity: Entity;
private _children;
private _parent;
private _localPosition;
private _localRotation;
private _localScale;
private _translationMatrix;
private _rotationMatrix;
private _scaleMatrix;
private _worldTransform;
private _worldToLocalTransform;
private _worldInverseTransform;
private _rotation;
private _position;
private _scale;
private _localTransform;
private _hierachyDirty;
private _localDirty;
private _localPositionDirty;
private _localScaleDirty;
private _localRotationDirty;
private _positionDirty;
private _worldToLocalDirty;
private _worldInverseDirty;
readonly childCount: number;
constructor(entity: Entity);
getChild(index: number): Transform;
readonly worldInverseTransform: Matrix2D;
readonly localToWorldTransform: Matrix2D;
readonly worldToLocalTransform: Matrix2D;
parent: Transform;
setParent(parent: Transform): this;
rotation: number;
localRotation: number;
position: Vector2;
localPosition: Vector2;
scale: Vector2;
localScale: Vector2;
rotationDegrees: number;
localRotationDegrees: number;
setLocalScale(scale: Vector2): this;
setScale(scale: Vector2): this;
setLocalRotationDegrees(degrees: number): this;
setLocalRotation(radians: number): this;
setRotation(radians: number): this;
setRotationDegrees(degrees: number): this;
setLocalPosition(localPosition: Vector2): this;
setPosition(position: Vector2): this;
setDirty(dirtyFlagType: DirtyType): void;
updateTransform(): void;
}
declare class Camera extends Component {
private _zoom;
private _origin;
private _transformMatrix;
private _inverseTransformMatrix;
private _minimumZoom;
private _maximumZoom;
private _areMatrixesDirty;
zoom: number;
minimumZoom: number;
maximumZoom: number;
origin: Vector2;
readonly transformMatrix: Matrix2D;
constructor();
setMinimumZoom(minZoom: number): Camera;
setMaximumZoom(maxZoom: number): Camera;
setZoom(zoom: number): this;
initialize(): void;
update(): void;
setPosition(position: Vector2): this;
updateMatrixes(): void;
destory(): void;
}
declare class EntitySystem {
private _scene;
private _entities;
private _matcher;
readonly matcher: Matcher;
scene: Scene;
constructor(matcher?: Matcher);
initialize(): void;
onChanged(entity: Entity): void;
add(entity: Entity): void;
onAdded(entity: Entity): void;
remove(entity: Entity): void;
onRemoved(entity: Entity): void;
update(): void;
lateUpdate(): void;
protected begin(): void;
protected process(entities: Entity[]): void;
protected lateProcess(entities: Entity[]): void;
protected end(): void;
}
declare abstract class EntityProcessingSystem extends EntitySystem {
constructor(matcher: Matcher);
abstract processEntity(entity: Entity): any;
lateProcessEntity(entity: Entity): void;
protected process(entities: Entity[]): void;
protected lateProcess(entities: Entity[]): void;
}
declare class BitSet {
private static LONG_MASK;
private _bits;
constructor(nbits?: number);
and(bs: BitSet): void;
andNot(bs: BitSet): void;
cardinality(): number;
clear(pos?: number): void;
private ensure;
get(pos: number): boolean;
intersects(set: BitSet): boolean;
isEmpty(): boolean;
nextSetBit(from: number): number;
set(pos: number, value?: boolean): void;
}
declare class ComponentList {
private _entity;
private _components;
private _componentsToAdd;
private _componentsToRemove;
private _tempBufferList;
constructor(entity: Entity);
readonly count: number;
readonly buffer: Component[];
add(component: Component): void;
remove(component: Component): void;
removeAllComponents(): void;
deregisterAllComponents(): void;
registerAllComponents(): void;
updateLists(): void;
private handleRemove;
getComponent<T extends Component>(type: any, onlyReturnInitializedComponents: boolean): T;
update(): void;
onEntityTransformChanged(comp: any): void;
}
declare class ComponentTypeManager {
private static _componentTypesMask;
static add(type: any): void;
static getIndexFor(type: any): number;
}
declare class EntityList {
scene: Scene;
private _entitiesToRemove;
private _entitiesToAdded;
private _tempEntityList;
private _entities;
constructor(scene: Scene);
readonly count: number;
readonly buffer: Entity[];
add(entity: Entity): void;
remove(entity: Entity): void;
findEntity(name: string): Entity;
update(): void;
removeAllEntities(): void;
updateLists(): void;
}
declare class EntityProcessorList {
private _processors;
add(processor: EntitySystem): void;
remove(processor: EntitySystem): void;
onComponentAdded(entity: Entity): void;
onComponentRemoved(entity: Entity): void;
onEntityAdded(entity: Entity): void;
onEntityRemoved(entity: Entity): void;
protected notifyEntityChanged(entity: Entity): void;
protected removeFromProcessors(entity: Entity): void;
begin(): void;
update(): void;
lateUpdate(): void;
end(): void;
getProcessor<T extends EntitySystem>(): T;
}
declare class Matcher {
protected allSet: BitSet;
protected exclusionSet: BitSet;
protected oneSet: BitSet;
static empty(): Matcher;
IsIntersted(e: Entity): boolean;
}
declare class Time {
static unscaledDeltaTime: any;
static deltaTime: number;
static timeScale: number;
private static _lastTime;
static update(currentTime: number): void;
}
declare class MathHelper {
static toDegrees(radians: number): number;
static toRadians(degrees: number): number;
static map(value: number, leftMin: number, leftMax: number, rightMin: number, rightMax: number): number;
static clamp(value: number, min: number, max: number): number;
}
declare class Matrix2D {
m11: number;
m12: number;
m21: number;
m22: number;
m31: number;
m32: number;
private static _identity;
static readonly identity: Matrix2D;
constructor(m11: number, m12: number, m21: number, m22: number, m31: number, m32: number);
translation: Vector2;
rotation: number;
rotationDegrees: number;
scale: Vector2;
static add(matrix1: Matrix2D, matrix2: Matrix2D): Matrix2D;
static divide(matrix1: Matrix2D, matrix2: Matrix2D): Matrix2D;
static multiply(matrix1: Matrix2D, matrix2: Matrix2D): Matrix2D;
static multiplyTranslation(matrix: Matrix2D, x: number, y: number): Matrix2D;
determinant(): number;
static invert(matrix: Matrix2D, result?: Matrix2D): Matrix2D;
static createTranslation(xPosition: number, yPosition: number, result?: Matrix2D): Matrix2D;
static createRotation(radians: number, result?: Matrix2D): Matrix2D;
static createScale(xScale: number, yScale: number, result?: Matrix2D): Matrix2D;
}
declare class Point {
x: number;
y: number;
constructor(x: number, y: number);
}
declare class Vector2 {
x: number;
y: number;
private static readonly unitVector2;
static readonly One: Vector2;
constructor(x: number, y: number);
static add(value1: Vector2, value2: Vector2): Vector2;
static divide(value1: Vector2, value2: Vector2): Vector2;
static multiply(value1: Vector2, value2: Vector2): Vector2;
static subtract(value1: Vector2, value2: Vector2): Vector2;
normalize(): void;
static transform(position: Vector2, matrix: Matrix2D): Vector2;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-15371
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-15047
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-2502
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-1350
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-22
View File
@@ -1,22 +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/framework/framework.js"
],
"game": [
"bin-debug/AssetAdapter.js",
"bin-debug/LoadingUI.js",
"bin-debug/Main.js",
"bin-debug/Platform.js",
"bin-debug/ThemeAdapter.js",
"bin-debug/game/MainScene.js",
"bin-debug/game/SpawnerComponent.js",
"bin-debug/game/SpawnerSystem.js"
]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1002 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

-5
View File
@@ -1,5 +0,0 @@
[
"<font color=0x00ff0c>Open-source</font>,<font color=0x00ff0c>Free</font>,<font color=0x00ff0c>Multi-platform</font>",
"Push <font color=0x00ff0c>Game </font>Forward",
"<font color=0x00ff0c>HTML5 </font>Game Engine"
]
-140
View File
@@ -1,140 +0,0 @@
{
"groups": [
{
"keys": "checkbox_select_disabled_png,checkbox_select_down_png,checkbox_select_up_png,checkbox_unselect_png,selected_png,border_png,header_png,radiobutton_select_disabled_png,radiobutton_select_down_png,radiobutton_select_up_png,radiobutton_unselect_png,roundthumb_png,thumb_png,track_png,tracklight_png,handle_png,off_png,on_png,button_down_png,button_up_png,thumb_pb_png,track_pb_png,track_sb_png,bg_jpg,egret_icon_png,description_json",
"name": "preload"
}
],
"resources": [
{
"url": "assets/CheckBox/checkbox_select_disabled.png",
"type": "image",
"name": "checkbox_select_disabled_png"
},
{
"url": "assets/CheckBox/checkbox_select_down.png",
"type": "image",
"name": "checkbox_select_down_png"
},
{
"url": "assets/CheckBox/checkbox_select_up.png",
"type": "image",
"name": "checkbox_select_up_png"
},
{
"url": "assets/CheckBox/checkbox_unselect.png",
"type": "image",
"name": "checkbox_unselect_png"
},
{
"url": "assets/ItemRenderer/selected.png",
"type": "image",
"name": "selected_png"
},
{
"url": "assets/Panel/border.png",
"type": "image",
"name": "border_png"
},
{
"url": "assets/Panel/header.png",
"type": "image",
"name": "header_png"
},
{
"url": "assets/RadioButton/radiobutton_select_disabled.png",
"type": "image",
"name": "radiobutton_select_disabled_png"
},
{
"url": "assets/RadioButton/radiobutton_select_down.png",
"type": "image",
"name": "radiobutton_select_down_png"
},
{
"url": "assets/RadioButton/radiobutton_select_up.png",
"type": "image",
"name": "radiobutton_select_up_png"
},
{
"url": "assets/RadioButton/radiobutton_unselect.png",
"type": "image",
"name": "radiobutton_unselect_png"
},
{
"url": "assets/ScrollBar/roundthumb.png",
"type": "image",
"name": "roundthumb_png"
},
{
"url": "assets/Slider/thumb.png",
"type": "image",
"name": "thumb_png"
},
{
"url": "assets/Slider/track.png",
"type": "image",
"name": "track_png"
},
{
"url": "assets/Slider/tracklight.png",
"type": "image",
"name": "tracklight_png"
},
{
"url": "assets/ToggleSwitch/handle.png",
"type": "image",
"name": "handle_png"
},
{
"url": "assets/ToggleSwitch/off.png",
"type": "image",
"name": "off_png"
},
{
"url": "assets/ToggleSwitch/on.png",
"type": "image",
"name": "on_png"
},
{
"url": "assets/Button/button_down.png",
"type": "image",
"name": "button_down_png"
},
{
"url": "assets/Button/button_up.png",
"type": "image",
"name": "button_up_png"
},
{
"url": "assets/ProgressBar/thumb_pb.png",
"type": "image",
"name": "thumb_pb_png"
},
{
"url": "assets/ProgressBar/track_pb.png",
"type": "image",
"name": "track_pb_png"
},
{
"url": "assets/ScrollBar/track_sb.png",
"type": "image",
"name": "track_sb_png"
},
{
"url": "assets/bg.jpg",
"type": "image",
"name": "bg_jpg"
},
{
"url": "assets/egret_icon.png",
"type": "image",
"name": "egret_icon_png"
},
{
"name": "description_json",
"type": "json",
"url": "config/description.json"
}
]
}
-34
View File
@@ -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"
}
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<e:Skin class="skins.ButtonSkin" states="up,down,disabled" minHeight="50" minWidth="100" xmlns:e="http://ns.egret.com/eui">
<e:Image width="100%" height="100%" scale9Grid="1,3,8,8" alpha.disabled="0.5"
source="button_up_png"
source.down="button_down_png"/>
<e:Label id="labelDisplay" top="8" bottom="8" left="8" right="8"
size="20"
textColor="0xFFFFFF" verticalAlign="middle" textAlign="center"/>
<e:Image id="iconDisplay" horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
-16
View File
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.CheckBoxSkin" states="up,down,disabled,upAndSelected,downAndSelected,disabledAndSelected" xmlns:e="http://ns.egret.com/eui">
<e:Group width="100%" height="100%">
<e:layout>
<e:HorizontalLayout verticalAlign="middle"/>
</e:layout>
<e:Image fillMode="scale" alpha="1" alpha.disabled="0.5" alpha.down="0.7"
source="checkbox_unselect_png"
source.upAndSelected="checkbox_select_up_png"
source.downAndSelected="checkbox_select_down_png"
source.disabledAndSelected="checkbox_select_disabled_png"/>
<e:Label id="labelDisplay" size="20" textColor="0x707070"
textAlign="center" verticalAlign="middle"
fontFamily="Tahoma"/>
</e:Group>
</e:Skin>
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.HScrollBarSkin" minWidth="20" minHeight="8" xmlns:e="http://ns.egret.com/eui">
<e:Image id="thumb" source="roundthumb_png" scale9Grid="3,3,2,2" height="8" width="30" verticalCenter="0"/>
</e:Skin>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.HSliderSkin" minWidth="20" minHeight="8" xmlns:e="http://ns.egret.com/eui">
<e:Image id="track" source="track_sb_png" scale9Grid="1,1,4,4" width="100%"
height="6" verticalCenter="0"/>
<e:Image id="thumb" source="thumb_png" verticalCenter="0"/>
</e:Skin>
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<e:Skin class="skins.ItemRendererSkin" states="up,down,disabled" minHeight="50" minWidth="100" xmlns:e="http://ns.egret.com/eui">
<e:Image width="100%" height="100%" scale9Grid="1,3,8,8" alpha.disabled="0.5"
source="button_up_png"
source.down="button_down_png"/>
<e:Label id="labelDisplay" top="8" bottom="8" left="8" right="8"
size="20" fontFamily="Tahoma"
textColor="0xFFFFFF" text="{data}" verticalAlign="middle" textAlign="center"/>
</e:Skin>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.PanelSkin" minHeight="230" minWidth="450" xmlns:e="http://ns.egret.com/eui">
<e:Image left="0" right="0" bottom="0" top="0" source="border_png" scale9Grid="2,2,12,12" />
<e:Group id="moveArea" left="0" right="0" top="0" height="45">
<e:Image left="0" right="0" bottom="0" top="0" source="header_png"/>
<e:Label id="titleDisplay" size="20" fontFamily="Tahoma" textColor="0xFFFFFF"
wordWrap="false" left="15" right="5" verticalCenter="0"/>
</e:Group>
<e:Button id="closeButton" label="close" bottom="5" horizontalCenter="0"/>
</e:Skin>
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.ProgressBarSkin" minWidth="30" minHeight="18" xmlns:e="http://ns.egret.com/eui">
<e:Image source="track_pb_png" scale9Grid="1,1,4,4" width="100%"
height="100%" verticalCenter="0"/>
<e:Image id="thumb" height="100%" width="100%" source="thumb_pb_png"/>
<e:Label id="labelDisplay" textAlign="center" verticalAlign="middle"
size="15" fontFamily="Tahoma" textColor="0x707070"
horizontalCenter="0" verticalCenter="0"/>
</e:Skin>
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.RadioButtonSkin" states="up,down,disabled,upAndSelected,downAndSelected,disabledAndSelected" xmlns:e="http://ns.egret.com/eui">
<e:Group width="100%" height="100%">
<e:layout>
<e:HorizontalLayout verticalAlign="middle"/>
</e:layout>
<e:Image fillMode="scale" alpha="1" alpha.disabled="0.5" alpha.down="0.7"
source="radiobutton_unselect_png"
source.upAndSelected="radiobutton_select_up_png"
source.downAndSelected="radiobutton_select_down_png"
source.disabledAndSelected="radiobutton_select_disabled_png"/>
<e:Label id="labelDisplay" size="20" textColor="0x707070"
textAlign="center" verticalAlign="middle"
fontFamily="Tahoma"/>
</e:Group>
</e:Skin>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.ScrollerSkin" minWidth="20" minHeight="20" xmlns:e="http://ns.egret.com/eui">
<e:HScrollBar id="horizontalScrollBar" width="100%" bottom="0"/>
<e:VScrollBar id="verticalScrollBar" height="100%" right="0"/>
</e:Skin>
@@ -1,9 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<e:Skin class="skins.TextInputSkin" minHeight="40" minWidth="300" states="normal,disabled,normalWithPrompt,disabledWithPrompt" xmlns:e="http://ns.egret.com/eui">
<e:Image width="100%" height="100%" scale9Grid="1,3,8,8" source="button_up_png"/>
<e:Rect height="100%" width="100%" fillColor="0xffffff"/>
<e:EditableText id="textDisplay" verticalCenter="0" left="10" right="10"
textColor="0x000000" textColor.disabled="0xff0000" width="100%" height="24" size="20" />
<e:Label id="promptDisplay" verticalCenter="0" left="10" right="10"
textColor="0xa9a9a9" width="100%" height="24" size="20" touchEnabled="false" includeIn="normalWithPrompt,disabledWithPrompt"/>
</e:Skin>
@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.ToggleSwitchSkin" states="up,down,disabled,upAndSelected,downAndSelected,disabledAndSelected" xmlns:e="http://ns.egret.com/eui">
<e:Image source="on_png"
source.up="off_png"
source.down="off_png"
source.disabled="off_png"/>
<e:Image source="handle_png"
horizontalCenter="-18"
horizontalCenter.upAndSelected="18"
horizontalCenter.downAndSelected="18"
horizontalCenter.disabledAndSelected="18"
verticalCenter="0"/>
</e:Skin>
@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.VScrollBarSkin" minWidth="8" minHeight="20" xmlns:e="http://ns.egret.com/eui">
<e:Image id="thumb" source="roundthumb_png" scale9Grid="3,3,2,2" height="30" width="8" horizontalCenter="0"/>
</e:Skin>
-5
View File
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<e:Skin class="skins.VSliderSkin" minWidth="25" minHeight="30" xmlns:e="http://ns.egret.com/eui">
<e:Image id="track" source="track_png" scale9Grid="1,1,4,4" width="7" height="100%" horizontalCenter="0"/>
<e:Image id="thumb" source="thumb_png" horizontalCenter="0" />
</e:Skin>
-452
View File
@@ -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);
}
}
-82
View File
@@ -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"));
}
}
-64
View File
@@ -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;
-52
View File
@@ -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;
-63
View File
@@ -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;
-55
View File
@@ -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;
-52
View File
@@ -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;
-63
View File
@@ -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;
-62
View File
@@ -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;
-62
View File
@@ -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;
-65
View File
@@ -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;
-95
View File
@@ -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;
-62
View File
@@ -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;
-65
View File
@@ -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;
-82
View File
@@ -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"));
}
}
-17
View File
@@ -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) {
}
}
-4209
View File
File diff suppressed because it is too large Load Diff
-90
View File
@@ -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"));
}
}
-90
View File
@@ -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"));
}
}

Some files were not shown because too many files have changed in this diff Show More