cocos_add_script
Add TypeScript scripts with metadata to Cocos Creator projects, generating required files and UUIDs for scene integration.
Instructions
Write a TypeScript script + its meta into the project.
rel_path can be either:
bare name like 'GameManager' -> writes assets/scripts/GameManager.ts
full path like 'assets/scripts/sub/Foo.ts'
Returns {path, rel_path, uuid}. The uuid is the standard 36-char form; use cocos_compress_uuid to get the 23-char form needed in scene files.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| rel_path | Yes | ||
| source | Yes |