Skip to content

Commit 55d359a

Browse files
committed
Merge branch 'v3.0-release' into v3.1-release
# Conflicts: # zh/editor/project/index.md
2 parents d8bf7e6 + e7da075 commit 55d359a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+450
-183
lines changed

en/SUMMARY.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -280,18 +280,20 @@
280280

281281
## Advanced
282282

283-
- [Extended Editor](editor/extension/readme.md)
283+
- [Extending the Editor](editor/extension/readme.md)
284284
- [The First Extension](editor/extension/first.md)
285285
- [Install And Share](editor/extension/install.md)
286286
- [Extension Description](editor/extension/define.md)
287-
- [Extended Panel](editor/extension/panel.md)
287+
- [Extension Panel](editor/extension/panel.md)
288288
- [Compose Panel](editor/extension/panel-boot.md)
289289
- [Panel Message](editor/extension/panel-messages.md)
290290
- [Contributions](editor/extension/contributions.md)
291291
- [Message](editor/extension/contributions-messages.md)
292292
- [Shortcuts](editor/extension/contributions-shortcuts.md)
293-
- [Extending the main menu](editor/extension/contributions-menu.md)
293+
- [Extending the Main Menu](editor/extension/contributions-menu.md)
294294
- [Extending the Assets Panel](editor/assets/extension.md)
295+
- [Extending the Project Settings Panel](editor/extension/contributions-project.md)
296+
- [Extending the Preferences Panel](editor/extension/contributions-preferences.md)
295297
- [Basic](editor/extension/basic.md)
296298
- [Extension](editor/extension/package.md)
297299
- [Message](editor/extension/messages.md)

en/advanced-topics/java-reflection.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# How to Call Java methods using JavaScript on Android
22

3-
> This document is based on v2.x. It may change slightly with Cocos Creator 3.0 and will be updated as soon as possible.
4-
53
With the Cocos Creator Android build, developers can call Java static methods directly in JavaScript. Doing so is very simple:
64

75
```js

en/advanced-topics/oc-reflection.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# How to call Objective-C functions using JavaScript on iOS/Mac
22

3-
> This document is based on v2.x. It may change slightly on Cocos Creator 3.0 and will be updated as soon as possible.
4-
53
With native iOS or Mac applications packaged with Cocos Creator, JavaScript calling Objective-C functions directly through the native language's reflection mechanism can be achieved with the following sample code:
64

75
```js

en/asset/dcc-export-mesh.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ Currently, most __Digital Content Creation (DCC)__ tools (__3DS Max__, __Maya__,
66

77
Because the coordinate system of the DCC tool and the game engine's coordinate system are not necessarily the same, some transformations are required when exporting a model to get the desired result in the engine. For example, __Blender's__ coordinate system is __x-axis right__, __y-axis outward__, __z-axis right-hand__ coordinate system, and __Cocos Creator 3.0__ is __x-axis right__, __y-axis__, __z-axis right-hand__ coordinate system, so rotation is required to make the axes consistent.
88

9-
The following uses Blender 2.8 as an example to introduce the model import process. First we create a model in Blender.
9+
The following uses Blender 2.8 as an example to introduce the model import process. First, create a model in Blender.
1010

1111
![blender model](./mesh/blender_model.png)
1212

13-
In [Blender's FBX Export Options](https://docs.blender.org/manual/en/2.80/addons/io_scene_fbx.html) documentation, we choose __up__ as __y up__ and __forward__ as __-z forward__.
13+
In [Blender's FBX Export Options](https://docs.blender.org/manual/en/2.80/addons/io_scene_fbx.html) documentation, choose __up__ as __y up__ and __forward__ as __-z forward__.
1414

1515
![blender export](./mesh/blender_export_fbx_1.png)
1616

17-
Imported into __Cocos Creator__, you can see that the nodes are rotated by __-90__ on the __x-axis__ in order to combine the __axis__ with __Cocos Creator__. The axes are aligned.
17+
Imported into __Cocos Creator__, notice that the nodes are rotated by __-90__ on the __x-axis__ in order to combine the __axis__ with __Cocos Creator__. The axes are aligned.
1818

1919
![blender export c3d](./mesh/blender_model_c3d.png)
2020

21-
If you don't want this rotation value, Blender's FBX export plugin provides an experimental function, __Apply Transform__, which can directly transform the rotation data into the model's vertex data.
21+
To use a different rotation value, Blender's FBX export plugin provides an experimental function, __Apply Transform__, which can directly transform the rotation data into the model's vertex data.
2222

2323
![blender export bake](./mesh/blender_export_bake.png)
2424

25-
You can see that the rotation data is gone in __Cocos Creator 3.0__.
25+
Notice that the rotation data is gone in __Cocos Creator 3.0__.
2626

2727
![blender export bake c3d](./mesh/blender_model_bake_c3d.png)
2828

@@ -37,10 +37,10 @@ Please read the following documents:
3737

3838
## Possible issues
3939

40-
During the game development process, the orientation of the model may be used. For example, if you want some objects to face the player (using the `LookAt()` method), you need to consider the initial orientation of the model. Here are two methods to adjust the initial orientation of the model.
40+
During the game development process, the orientation of the model may be used. For example, if some objects should face the player (using the `LookAt()` method), consider the initial orientation of the model. Here are two methods to adjust the initial orientation of the model.
4141

42-
1. In __Cocos Creator 3.0__, the __-z-axis__ is used as the forward direction, while in Blender, the forward direction is __+y-axis__, so when making a model, the positive direction of the __y-axis__ should be used as the orientation of the object, and the derived transformation later, in __Cocos Creator__, the __-z-axis__ will be used as the front direction.
43-
2. If you do not want to change the orientation in the DCC tool, you can try adding a parent node to the imported model in the scene, and then rotate the model so that the initial orientation of the model is the __-z-axis__. All subsequent rotation-related operations are based on the parent. A node is an operation object.
42+
1. In __Cocos Creator 3.0__, the __-z-axis__ is used as the forward direction, while in Blender, the forward direction is __+y-axis__, when making a model, the positive direction of the __y-axis__ should be used as the orientation of the object, and the derived transformation later, in __Cocos Creator__, the __-z-axis__ will be used as the front direction.
43+
2. To not change the orientation in the DCC tool, try adding a parent node to the imported model in the scene, and then rotate the model so that the initial orientation of the model is the __-z-axis__. All subsequent rotation-related operations are based on the parent. A node is an operation object.
4444

4545
## Artist's production specifications
4646

en/audio-system/audiosource.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,4 @@
1414
|**PlayOnAwake** | Whether to play audio automatically after the component is activated |
1515
|**Volume** | Audio volume, ranging from 0 to 1 |
1616

17-
For additional details, please refer to the [AudioSource API](__APIDOC__/en/classes/component_audio.audiosource.html) documentation.
18-
19-
For specific playback controls, please refer to the [Audio System Overview](./overview.md) documentation.
17+
For more script interfaces for AudioSource, please refer to the [AudioSource API](__APIDOC__/en/classes/component_audio.audiosource.html). For specific playback controls, please refer to the [Audio System Overview](./overview.md) documentation.

en/editor/components/spine.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Select the node and choose **Add Component -> Spine -> Skeleton** on the **Inspe
1818
| SkeletonData | Skeleton information data, drag and drop the skeleton assets exported from Spine. into this property
1919
| Default Skin | Select the default skin.
2020
| Animation | The name of the currently playing animation.
21-
| Animation Cache Mode | Rendering mode, the default is **REALTIME** mode. <br>1. **REALTIME** mode, real-time computing, supports all Spine features. <br>2. **SHARED_CACHE** mode, caches, and shares skeletal animations and texture data, equivalent to pre-baked skeletal animations. **SHARED_CACHE** mode has higher performance, but does not support motion fusion, motion overlay, and only supports motion start and end events. As for memory, when creating N (N>=3) animations with the same skeleton and the same action, the memory advantage is obvious. In summary, **SHARED_CACHE** mode is suitable for scene animations, effects, replica monsters, NPCs, etc., and can greatly improve frame rates and reduce memory consumption. <br>3. **PRIVATE_CACHE** mode, similar to **SHARED_CACHE** but does not share animation and texture data, so there is no memory advantage, only performance advantage. Use **PRIVATE_CACHE** to take advantage of the high performance of the cache mode and to also implement texture replacement (which cannot share the texture data).
21+
| Animation Cache Mode | Rendering mode, the default is **REALTIME** mode. <br>1. **REALTIME** mode, real-time computing, supports all Spine features. <br>2. **SHARED_CACHE** mode, caches, and shares skeletal animations and texture data, equivalent to pre-baked skeletal animations. **SHARED_CACHE** mode has higher performance, but does not support motion fusion, motion overlay, and only supports motion start and end events. As for memory, when creating N (N>=3) animations with the same skeleton and the same action, the memory advantage is obvious. In summary, **SHARED_CACHE** mode is suitable for scene animations, effects, replica monsters, NPCs, etc., and can greatly improve frame rates and reduce memory consumption. <br>3. **PRIVATE_CACHE** mode, similar to **SHARED_CACHE**, but does not share animation and texture data, and will occupy extra memory, there is only a performance advantage, and it may cause stutter if using this mode a lot to play animation. Use **PRIVATE_CACHE** to take advantage of the high performance of the cache mode and to also implement texture replacement (which cannot share the texture data).
2222
| Loop | Whether to loop the current animation.
2323
| Premultiplied Alpha | Whether to enable premultiplied alpha for the image, default is True.<br>This item needs to be disabled when the transparent area of the image appears as a color block, and enabled when the translucent area of the image turns black.
2424
| Time Scale | The time scale of all animations in the current skeleton.
@@ -199,7 +199,7 @@ The Spine attachment function allows for the detection of a collision of a part
199199

200200
![collider](./spine/collider0.png)
201201

202-
1. First, set the **2D Physics System** to **Builtin 2D Physics System** in the **Project -> Project Settings -> Feature Crop** of the editor menu bar.
202+
1. First, set the **2D Physics System** to **Builtin 2D Physics System** in the **Project -> Project Settings -> Feature Cropping** of the editor menu bar.
203203

204204
![collider](./spine/collider1.png)
205205

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Extending the Preferences Panel
2+
3+
The editor allows each extension to register its own configuration, and then displays some or all of the editor configuration within the Preferences panel. In this panel, the modifications are editor feature-related configurations.
4+
5+
For project-related configurations, please review the [Project Settings](./contributions-project.md) documentation.
6+
7+
## Description of the Preferences Panel
8+
9+
The Preferences panel can be opened via the top menu **Cocos Creator -> Preferences**.
10+
11+
![preferences](./image/preferences-tool.png)
12+
13+
The Preferences panel is divided into left and right sides.
14+
15+
- The left side shows the names of functional extensions that provide configuration items.
16+
- On the right side is an action panel rendered according to the configuration.
17+
18+
Changes made in the panel are immediately modified to the corresponding configuration items.
19+
20+
Normally, the configuration is stored at the global level. If the configuration needs to be put into a project, then move the mouse over the configuration entry and select **Record to project** on the small icon that appears on the left side. This data will be saved to the project, and changes to it will not affect other projects.
21+
22+
> **Notes**:
23+
> 1. If the auto-rendered configuration is stored in the project, the icon on the left side will turn yellow to indicate it. To reuse the global configuration, click the icon on the left side and select **Restore to Global Configuration**, doing so will discard the project settings.
24+
> 2. Only auto-rendered configurations will automatically add icons. If properties are not defined, implement the icon change function in the panel as needed.
25+
26+
Also, there are some configurations that cannot switch between global and local storage location, such as preview scenes, which must be stored in the project. This part of the configuration should use the custom panel.
27+
28+
For more information about the **Preferences** panel, please refer to the [Preferences](../../editor/preferences/index.md) documentation.
29+
30+
## Registration Methods
31+
32+
Preferences allow to display configurations in two ways.
33+
34+
1. General configuration
35+
2. Lab configuration
36+
37+
General settings are displayed directly as tabs, while lab switches are displayed centrally in a separate tab.
38+
39+
- When the functionality provided by the extension is more stable it is recommended to place the configuration data within the generic functionality.
40+
- When the functionality provided by the extension is in the development stage, it is recommended that the switch configuration data of the functionality be placed in the lab configuration.
41+
42+
First define the configuration in `contributions.profile.editor`. The data to be displayed in the **Preferences** panel can then be defined in `contributions.preferences`.
43+
44+
For details on how to define a `profile`, please review the [Profile](./profile.md) documentation.
45+
46+
## Registering Preferences Data
47+
48+
`package.json`
49+
50+
```JSON5
51+
{
52+
"name": "hello-world",
53+
"contributions": {
54+
"profile": {
55+
"editor": {
56+
"foo": {
57+
"default": 0,
58+
"label": "foo"
59+
},
60+
"bar": {
61+
"default": false,
62+
"label": "bar"
63+
}
64+
}
65+
},
66+
"preferences": {
67+
"properties": {
68+
"foo": {
69+
"ui": "ui-num-input"
70+
}
71+
},
72+
"laboratory": ["bar"]
73+
}
74+
}
75+
}
76+
```
77+
78+
Two editor configurations, `foo` and `bar`, have been defined and added the configurations to the `preferences`.
79+
- The `foo` is stored in the general profile.
80+
- The `bar` is stored in the `laboratory` profile.
81+
82+
The defined `profile` data will be automatically registered to `default`. Using `Editor.Profile.getConfig` will get the default values.
83+
84+
The `contributions` of `package.json` need to be defined like the following:
85+
86+
```typescript
87+
interface package
88+
{
89+
"name": string;
90+
"contributions": {
91+
"profile": {
92+
"editor": {
93+
[key:string]: ProfileItem;
94+
};
95+
};
96+
"preferences": {
97+
/**
98+
* The properties data can be filled in to auto-render the configuration.
99+
* The key in properties corresponds to the editor configuration key, and the value corresponds to the information needed for auto-rendering.
100+
* If there is a ui defined in properties then it will be automatically rendered under the tab of the functional extension name.
101+
**/
102+
"properties": {
103+
[key:string]: UIInfo
104+
};
105+
/**
106+
* If the configuration is more complex and auto-rendering can't meet the demand, you can fill in custom data.
107+
* Fill in the entry for the custom panel there.
108+
* The panel will appear below the autorender (if properties are defined).
109+
**/
110+
"custom": string;
111+
/**
112+
* The labs are listed as a separate tab within the editor, mainly to provide a switch display for some experimental functions.
113+
* You can fill in laboratory data to add an editor configuration of type Boolean to the lab switches.
114+
* Laboratory is an array, the key in the array points to the key in the editor configuration, the corresponding data must be of Boolean type.
115+
* The key filled in here will be displayed in the Lab tab of Preferences.
116+
**/
117+
"laboratory": string[];
118+
};
119+
...
120+
}
121+
...
122+
}
123+
```
124+
125+
```typescript
126+
interface UIInfo {
127+
// which ui element to use for rendering, e.g. "ui-num-input"
128+
ui: string;
129+
attributes: {
130+
// The attribute data allowed on the ui element, each ui allows different parameters, see the ui-kit chapter for details
131+
// Assuming the ui is "ui-num-input"
132+
// This can be filled with "step": 1
133+
[key:string]: any;
134+
};
135+
}
136+
```
137+
138+
For more information on how to customize the panel please review the [Panel Definition](./panel.md) documentation.

0 commit comments

Comments
 (0)