{"id":18996821,"url":"https://github.com/ailhc/egf-ccc3d-empty","last_synced_at":"2026-07-02T10:31:07.186Z","repository":{"id":97517930,"uuid":"316657917","full_name":"AILHC/egf-ccc3d-empty","owner":"AILHC","description":"基于EasyGameFramework的CocosCreator3D 1.2的空项目","archived":false,"fork":false,"pushed_at":"2020-11-28T12:48:52.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-21T12:26:16.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AILHC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-28T04:42:37.000Z","updated_at":"2020-11-28T12:48:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3e4b699-c8a4-4747-bd47-48cbce02e2b9","html_url":"https://github.com/AILHC/egf-ccc3d-empty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AILHC/egf-ccc3d-empty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AILHC%2Fegf-ccc3d-empty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AILHC%2Fegf-ccc3d-empty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AILHC%2Fegf-ccc3d-empty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AILHC%2Fegf-ccc3d-empty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AILHC","download_url":"https://codeload.github.com/AILHC/egf-ccc3d-empty/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AILHC%2Fegf-ccc3d-empty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35043933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-02T02:00:06.368Z","response_time":173,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T17:37:10.974Z","updated_at":"2026-07-02T10:31:07.151Z","avatar_url":"https://github.com/AILHC.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# egf-ccc3d-empty\n    基于EasyGameFramework的CocosCreator3D 1.2的空项目\n\n## 简介\n可以通过稍微麻烦一点的方式来安装npm包，或者通过typescript以添加模块扩展框架\n## 安装\n1. npm下载库\nnpm i @ailhc/egf-core\n2. 复制dist/system 下的文件到assets里\n3. 修改一下名字(防止冲突) 比如 将index.js index.d.ts 改成 egf-core.js egf-core.d.ts\n4. 在编辑器中 将egf-core.js设置为插件，不要模拟高级全局变量，其他按需勾选\n\n\u003ePS: 其他扩展库类似，本地开发的，只需要复制dist/system发布目录下的文件就行\n## 使用\n1. 方式一:\n打开 start 场景\n看脚本 AppMain.ts\n通过 CocosCreator加载脚本的逻辑，加载即运行框架的初始化\n这个时机是在引擎加载完成后，插件脚本加载完后，场景组件脚本生命周期运行之前（场景加载运行之前）\n但是如果你的其他脚本也是通过这种方式执行,那么这个时机就会有冲突，比如装饰器之类的\n\n```ts\nexport class AppMain {\n    public static app: App\u003cIModuleMap\u003e;\n    public static initFramework() {\n        const app = new App\u003cIModuleMap\u003e();\n        AppMain.app = app;\n        app.bootstrap([new FrameworkLoader()]);\n        setModuleMap(app.moduleMap);\n        app.init();\n        window[\"m\"] = m;//挂在到全局，方便控制台调试，生产环境可以屏蔽=\u003e安全\n        m.helloWorld.say();\n    }\n\n}\nAppMain.initFramework();\n```\n\n2. 方式二:\n打开 start-with-comp 场景\n看脚本AppMainComp.ts\n通过场景中的节点组件的生命周期来启动和初始化框架\n这个时机是引擎加载完成后，插件脚本加载后，框架所在场景加载后，框架在挂节点的生命周期运行后开始。\n\n\u003ePS: 这里的时机就比较靠后了，依赖节点，注意这个组件实例会被切换场景后清掉。\n\n3. 每个文件的作用说明\n    \n    a. AppMain.ts/AppMainComp.ts\n\n        框架初始化用的\n    b. ModuleMap.ts\n\n        这是一个安全的全局引用依赖点 ，而且只需要将m这个变量挂载到window下就可以方便调试了\n        IModuleMap 这是全局模块接口声明\n        \n        这些都是可以自定义和框架无关。\n        没有它你也可以通过 获取app来获取和调用模块\n    c. FrameworkLoader.ts\n\n        这个的作用是进行模块加载，隔离模块加载的细节，可以通过替换来达到不同环境加载不同模块或者给予相同模块不同的初始化参数等等\n    d. HelloWorld.ts\n\n        扩展模块","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failhc%2Fegf-ccc3d-empty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Failhc%2Fegf-ccc3d-empty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failhc%2Fegf-ccc3d-empty/lists"}