A LayaAir plugin for migrating Cocos Creator project assets to LayaAir.
The plugin scans assets and meta files in a Cocos project, converts supported asset types into Laya formats, and automatically handles common components (UI, mesh, light, camera, collider, rigid body, animation, etc.).
中文版说明请参见 README.zh-CN.md
- LayaAir: 3.3.6 or higher
- Cocos: Verified with Cocos Creator 3.x; 2.x is not tested, but should work in theory
- Download this plugin and place it anywhere under the
assetsdirectory of your Laya project. - In the main menu, find:
Migrate Cocos / Migrate Cocos Project Assets(迁移Cocos / 迁移Cocos项目资源). - Follow the prompts:
- First dialog: select the source Cocos asset folder (usually the
assetsdirectory under the Cocos project, or any of its subfolders). - Second dialog: select the target Laya asset folder (must be a subfolder inside the current Laya project's
assetsdirectory).
- First dialog: select the source Cocos asset folder (usually the
- Wait for the conversion to finish and check the Laya console output for progress and possible warnings.
-
File conversion support
- Conversion of
AnimationClipfiles and animation state machine files. - Conversion of model files:
fbx,gltf,glb, andobj. - Basic conversion of
effectassets (only the rough structure is converted; you will still need to adjust details manually). - Conversion of
mtlmaterial files. - Conversion of prefab and scene files.
- Conversion of
-
Component conversion support
- UI components (
cc.Canvas,cc.Widget,cc.UITransform,cc.Button,cc.Label,cc.Sprite,cc.ScrollView, etc.). - Animation components:
cc.Animation,cc.SkeletalAnimation,cc.animation.AnimationController(note: for FBX assets using "Promote Single Root Node" that generate aRootNode, animations may be offset and fail to play correctly). - Physics components:
cc.BoxCollider,cc.CapsuleCollider,cc.ConeCollider,cc.CylinderCollider,cc.RigidBody,cc.SphereCollider. cc.Camera.- Lights:
cc.DirectionalLight,cc.PointLight,cc.SpotLight. cc.Line.cc.ReflectionProbe.cc.LODGroup.cc.MeshCollider,cc.MeshRenderer.cc.SkinnedMeshRenderer.
- UI components (
-
Shader conversion support
builtin-standardskystandardtoon
If you want to support more asset types or customize the conversion logic, you can:
- Add new asset converters:
- In
core/assets, add a new class that implements theICocosAssetConversioninterface. - Register the file extension and converter mapping in
core/Registry.tsviaConversionRegistry.
- In
- Add/modify component converters:
- Add or modify the corresponding component converter files under
core/components.
- Add or modify the corresponding component converter files under
This plugin is released under the MIT License.