|
| 1 | +# Project Structure |
| 2 | + |
| 3 | +Using the Dashboard, a new project can be created. `HelloWorld` is the classic first example. Once created, the project has a specific folder structure, and this structure can be used to get familiar with the Cocos Creator project folder structure. |
| 4 | + |
| 5 | +## Project Folder Structure |
| 6 | + |
| 7 | +After creating and opening a Cocos Creator project for the first time, the developer project folder will have the following structure. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +- `assets`: the assets directory |
| 12 | + |
| 13 | +- `build`: build directory (generated after building a platform) |
| 14 | + |
| 15 | +- `library`: directory of imported assets |
| 16 | + |
| 17 | +- `local`: log files directory |
| 18 | + |
| 19 | +- `profiles`: editor configuration |
| 20 | + |
| 21 | +- `temp`: temporary files directory |
| 22 | + |
| 23 | +- `package.json`: project configuration |
| 24 | + |
| 25 | +### `assets` |
| 26 | + |
| 27 | +`assets` is used to hold all local assets, scripts, and third-party library files in the game. Only the contents of the `assets` directory will be displayed in the **Assets** panel. Each file in `assets` generates a `.meta` file with the same name after importing the project, which is used to store the corresponding asset configuration and index information. The `.meta` file needs to be submitted to the version control system as well, please review the [Asset Management Notes --- meta Files](../../asset/meta.md) documentation. |
| 28 | + |
| 29 | +Project or design source files generated by some third-party tools, such as `.tps` files for TexturePacker, or `.psd` files for Photoshop, can optionally be managed outside of `assets`. |
| 30 | + |
| 31 | +### `build` |
| 32 | + |
| 33 | +After publishing a project using the default publish path through **Project -> Build** in the editor main menu, the editor will create a `build` directory under the project path and store all builds for the target platform. |
| 34 | + |
| 35 | +### `library` |
| 36 | + |
| 37 | +The `library` is generated by importing the assets from `assets`, where the structure of the files and the format of the assets will be processed into the form needed for the final game release. |
| 38 | + |
| 39 | +When `library` is lost or corrupted, just delete the whole `library` folder and open the project again, and the repository will be regenerated. |
| 40 | + |
| 41 | +### `local` |
| 42 | + |
| 43 | +The `local` folder contains configuration information for the project on the local machine, including the editor panel layout, window size, location, and other information. Developers do not need to care about the contents here. |
| 44 | + |
| 45 | +### `profiles` |
| 46 | + |
| 47 | +The `profiles` folder contains configuration information for the editor, including build configuration information for each target platform, scene configuration information, etc. |
| 48 | + |
| 49 | +### `extensions` |
| 50 | + |
| 51 | +The `extensions` folder is used to place custom extensions for this project. To install extensions manually, create this folder manually. To uninstall the extensions, just delete the corresponding folder in `extensions`. |
| 52 | + |
| 53 | +### `settings` |
| 54 | + |
| 55 | +`settings` contains project-specific settings, such as configuration information in the **Project Settings** panel. To synchronize project settings between developers, please add the settings directory to version control. |
| 56 | + |
| 57 | +### `temp` |
| 58 | + |
| 59 | +`temp` is a temporary folder for caching some of Cocos Creator's temporary files locally. This folder can be deleted manually after closing Cocos Creator, and developers don't need to care about the contents. |
| 60 | + |
| 61 | +### `package.json` |
| 62 | + |
| 63 | +The `package.json` file, together with the `assets` folder, serves as a flag to verify the legitimacy of a Cocos Creator project, and only folders that include these two contents can be opened as Cocos Creator projects. Developers don't need to care about the contents inside. |
| 64 | + |
| 65 | +## Version control |
| 66 | + |
| 67 | +Cocos Creator automatically generates `.gitignore` files when a new project is created to exclude files that should not be committed to the git repository. If using another version control system, or if needing to commit the project elsewhere, be careful to only commit `assets`, `extensions`, `settings`, `package.json`, and any other manually added files associated with the project. |
0 commit comments