{"id":19831831,"url":"https://github.com/ialex32x/layabase","last_synced_at":"2025-10-09T02:09:25.458Z","repository":{"id":70073006,"uuid":"149537231","full_name":"ialex32x/layabase","owner":"ialex32x","description":"一些简单的功能","archived":false,"fork":false,"pushed_at":"2019-05-08T15:05:27.000Z","size":246,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T02:04:30.972Z","etag":null,"topics":["behavior-tree","laya","layaair","library","quadtree"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/ialex32x.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":"2018-09-20T02:05:24.000Z","updated_at":"2022-09-13T09:03:21.000Z","dependencies_parsed_at":"2023-04-25T02:23:40.076Z","dependency_job_id":null,"html_url":"https://github.com/ialex32x/layabase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ialex32x/layabase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ialex32x%2Flayabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ialex32x%2Flayabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ialex32x%2Flayabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ialex32x%2Flayabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ialex32x","download_url":"https://codeload.github.com/ialex32x/layabase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ialex32x%2Flayabase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000773,"owners_count":26082906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["behavior-tree","laya","layaair","library","quadtree"],"created_at":"2024-11-12T11:35:00.953Z","updated_at":"2025-10-09T02:09:25.426Z","avatar_url":"https://github.com/ialex32x.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# layabase\n一些简单的功能\n\n比如简化的 behaviour tree, astar pathfinding 等\n\n\nBehaviour Tree\n```typescript\nlet prl = new BehaveParallel()\n// 只执行一轮的序列 (无限执行不传参即可)\nlet seq1 = new BehaveSequence(1) \nseq1.addChild(new BehaveWait(3000))\n// 执行指定函数动作的行为节点\nseq1.addChild(new BehaveAction(ctx =\u003e {\n    console.log(\"bt.action1\", Laya.timer.currTimer / 1000)\n}))\nprl.addChild(seq1)\nlet seq2 = new BehaveSequence(6)\nseq2.addChild(new BehaveWait(1000))\nseq2.addChild(new BehaveAction(ctx =\u003e {\n    console.log(\"bt.action2\", Laya.timer.currTimer / 1000)\n}))\nprl.addChild(seq2)\n\nlet mgr = new BehaveManager()\nmgr.add(\"test\", prl)\n\nlet runner1 = mgr.run(\"test\", null)\nlet restart = true\nLaya.timer.loop(1, this, () =\u003e {\n    if (!runner1.update(Laya.timer.delta)) {\n        if (restart) {\n            // 执行结束后可以重启\n            runner1.restart()\n            restart = false\n        }\n    }\n})\n```\n\nRequest\n```typescript\nHttpRequest.sharedBaseUrl = \"https://yourdomain\"\n// 发起GET请求 (payload会转换成url的一部分)\nHttpRequest.GET(\"/your/api/path\", {\n    data1: \"test\", \n    data2: 123, \n}, (status, res) =\u003e {\n    console.log(\"GET\", status, res)\n}).timeout(3)\n\n// POST/FORM 接口与 GET 方式一致\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fialex32x%2Flayabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fialex32x%2Flayabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fialex32x%2Flayabase/lists"}