Skip to content

Project Structure

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.

Project Folder Structure

After creating and opening a Cocos Creator project for the first time, the developer project folder will have the following structure.

project-file

  • assets: the assets directory

  • build: build directory (generated after building a platform)

  • library: directory of imported assets

  • local: log files directory

  • profiles: editor configuration

  • temp: temporary files directory

  • package.json: project configuration

assets

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 documentation.

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.

build

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.

library

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.

When library is lost or corrupted, just delete the whole library folder and open the project again, and the repository will be regenerated.

local

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.

profiles

The profiles folder contains configuration information for the editor, including build configuration information for each target platform, scene configuration information, etc.

extensions

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.

settings

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.

temp

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.

package.json

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.

Version control

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.