Skip to content

Extend Existing Functionality

Cocos Creator supports contributions between extensions.

When writing an extension, it is possible to query whether the existing functions in the editor provide the ability of receiving contributions externally.

If there are functions that provide the ability of receiving contributions externally, use these functions when writing extensions.

Contributions Data Definition

The contributions function, uniformly defined in the contributions field in package.json, is as follows.

JSON5
{
    "name": "hello-world",
    "contributions": {
        "builder":{ ... },
        "assets":{ ... },
        "profile": { ... },
        "scene": { ... },
        "menu": [ ... ],
        "inspector":{ ... },
        "messages": { ... },
        "shortcuts": { ... },
        "preferences": { ... },
        "project": { ... }
    },
}

Field Descriptions

contributions provides the ability to interact with the editor's various functional systems, the main functions involved are as follows: