{"id":20266352,"url":"https://github.com/arkntools/unity-js","last_synced_at":"2025-04-11T03:20:25.628Z","repository":{"id":176371534,"uuid":"657926857","full_name":"arkntools/unity-js","owner":"arkntools","description":"Unity AssetBundle 解包","archived":false,"fork":false,"pushed_at":"2024-06-06T16:09:53.000Z","size":307,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-09T13:47:19.457Z","etag":null,"topics":["assetsbundle","unity","unpacker"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@arkntools/unity-js","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arkntools.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":"2023-06-24T08:29:12.000Z","updated_at":"2024-06-12T14:49:03.160Z","dependencies_parsed_at":null,"dependency_job_id":"30a77d2f-b1bf-4716-b629-54749d60ae41","html_url":"https://github.com/arkntools/unity-js","commit_stats":null,"previous_names":["arkntools/unity-js"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkntools%2Funity-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkntools%2Funity-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkntools%2Funity-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkntools%2Funity-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arkntools","download_url":"https://codeload.github.com/arkntools/unity-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248333961,"owners_count":21086288,"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","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":["assetsbundle","unity","unpacker"],"created_at":"2024-11-14T12:08:49.203Z","updated_at":"2025-04-11T03:20:25.619Z","avatar_url":"https://github.com/arkntools.png","language":"TypeScript","readme":"# unity-js\n\n[![NPM version](https://img.shields.io/npm/v/@arkntools/unity-js?style=flat-square)](https://www.npmjs.com/package/@arkntools/unity-js)\n\nJS implementation of Unity AssetBundle unpacking.\n\nOnly the minimum implementation required for the project was done. If you need complete functionality, it is recommended to use a more complete library in other languages.\n\nCurrently only supports:\n\n- TextAsset\n- Texture2d\n- Sprite\n- SpriteAtlas\n\n```js\nimport fs from 'fs';\nimport { loadAssetBundle, AssetType, BundleEnv } from '@arkntools/unity-js';\n\n(async () =\u003e {\n  const bundle = await loadAssetBundle(fs.readFileSync('character_table003334.ab', { env: BundleEnv.ARKNIGHTS }));\n  for (const obj of bundle.objects) {\n    if (obj.type === AssetType.TextAsset) {\n      fs.writeFileSync(`${obj.name}.bytes`, obj.data);\n      break;\n    }\n  }\n})();\n\n(async () =\u003e {\n  const bundle = await loadAssetBundle(fs.readFileSync('spritepack_ui_char_avatar_h1_0.ab', { env: BundleEnv.ARKNIGHTS }));\n  for (const obj of bundle.objects) {\n    if (obj.type === AssetType.Sprite \u0026\u0026 obj.name === 'char_002_amiya') {\n      fs.writeFileSync(`${obj.name}.png`, await obj.getImage()!);\n      break;\n    }\n  }\n})();\n\n(async () =\u003e {\n  const bundle = await loadAssetBundle(fs.readFileSync('char_1028_texas2.ab', { env: BundleEnv.ARKNIGHTS }), {\n    // Some sprites may not give the PathID of the alpha texture, you can provide a custom function to find it.\n    findAlphaTexture: (texture, assets) =\u003e\n      assets.find(({ name }) =\u003e name === `${texture.name}[alpha]`),\n  });\n  for (const obj of bundle.objects) {\n    if (obj.type === AssetType.Sprite \u0026\u0026 obj.name === 'char_1028_texas2_1') {\n      fs.writeFileSync(`${obj.name}.png`, await obj.getImage()!);\n      break;\n    }\n  }\n})();\n```\n\n## References\n\n- [Perfare/AssetStudio](https://github.com/Perfare/AssetStudio)\n- [RazTools/Studio](https://github.com/RazTools/Studio)\n- [K0lb3/UnityPy](https://github.com/K0lb3/UnityPy)\n- [yuanyan3060/unity-rs](https://github.com/yuanyan3060/unity-rs)\n- [MooncellWiki/UnityPy](https://github.com/MooncellWiki/UnityPy)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkntools%2Funity-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farkntools%2Funity-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkntools%2Funity-js/lists"}