diff --git a/cocos/core/3d/framework/camera-component.ts b/cocos/core/3d/framework/camera-component.ts
index 2fd618bf25..15f5688a37 100644
--- a/cocos/core/3d/framework/camera-component.ts
+++ b/cocos/core/3d/framework/camera-component.ts
@@ -41,9 +41,7 @@ import { Enum } from '../../value-types';
import { CameraDefaultMask } from '../../pipeline/define';
/**
- * @en
- * The projection type
- * @zh
+ * The projection type
* 投影类型。
* @static
* @enum CameraComponent.Projection
diff --git a/cocos/core/3d/framework/model-component.ts b/cocos/core/3d/framework/model-component.ts
index 5634b590a4..bd5897608a 100644
--- a/cocos/core/3d/framework/model-component.ts
+++ b/cocos/core/3d/framework/model-component.ts
@@ -36,8 +36,8 @@ import { builtinResMgr } from '../builtin';
import { RenderableComponent } from './renderable-component';
/**
- * @en Shadow projection mode
- * @zh 阴影投射方式。
+ * Shadow projection mode
+ * 阴影投射方式。
*/
const ModelShadowCastingMode = Enum({
/**
diff --git a/cocos/core/animation/animation-clip.ts b/cocos/core/animation/animation-clip.ts
index c134a96424..36aa47a313 100644
--- a/cocos/core/animation/animation-clip.ts
+++ b/cocos/core/animation/animation-clip.ts
@@ -121,25 +121,25 @@ export class AnimationClip extends Asset {
}
/**
- * 动画帧率,单位为帧/秒。
+ * @zh 动画帧率,单位为帧/秒。
*/
@property
public sample = 60;
/**
- * 动画的播放速度。
+ * @zh 动画的播放速度。
*/
@property
public speed = 1;
/**
- * 动画的循环模式。
+ * @zh 动画的循环模式。
*/
@property
public wrapMode = AnimationWrapMode.Normal;
/**
- * 动画的曲线数据。
+ * @zh 动画的曲线数据。
* @deprecated 请转用 `this.curves`
*/
@property
@@ -149,7 +149,7 @@ export class AnimationClip extends Asset {
private _curves: ITargetCurveData[] = [];
/**
- * 动画包含的事件数据。
+ * @zh 动画包含的事件数据。
*/
@property({visible: false})
public events: IAnimationEventData[] = [];
@@ -177,7 +177,7 @@ export class AnimationClip extends Asset {
protected _hash = 0;
/**
- * 动画的周期。
+ * @zh 动画的周期。
*/
get duration () {
return this._duration;
@@ -188,7 +188,7 @@ export class AnimationClip extends Asset {
}
/**
- * 动画所有时间轴。
+ * @zh 动画所有时间轴。
*/
get keys () {
return this._keys;
@@ -250,8 +250,8 @@ export class AnimationClip extends Asset {
}
/**
- * 提交曲线数据的修改。
- * 当你修改了 `this.curveDatas`、`this.keys` 或 `this.duration`时,
+ * @zh 提交曲线数据的修改。
+ * 当你修改了 `this.curveDatas`、`this.keys` 或 `this.duration`时,
* 必须调用 `this.updateCurveDatas()` 使修改生效。
* @deprecated
*/
@@ -261,7 +261,7 @@ export class AnimationClip extends Asset {
}
/**
- * 提交事件数据的修改。
+ * @zh 提交事件数据的修改。
* 当你修改了 `this.events` 时,必须调用 `this.updateEventDatas()` 使修改生效。
* @protected
*/
@@ -270,7 +270,8 @@ export class AnimationClip extends Asset {
}
/**
- * Gets the event group shall be processed at specified ratio.
+ * @en Gets the event group shall be processed at specified ratio.
+ * @zh 获取事件组应按指定比例处理。
* @param ratio The ratio.
* @protected
*/
@@ -283,7 +284,7 @@ export class AnimationClip extends Asset {
}
/**
- * 返回本动画是否包含事件数据。
+ * @zh 返回本动画是否包含事件数据。
* @protected
*/
public hasEvents () {
diff --git a/cocos/core/animation/animation-component.ts b/cocos/core/animation/animation-component.ts
index f2b66c1c8c..c1c5674d19 100644
--- a/cocos/core/animation/animation-component.ts
+++ b/cocos/core/animation/animation-component.ts
@@ -425,7 +425,8 @@ export class AnimationComponent extends Component implements IEventTarget {
}
/**
- * IEventTarget implementations, they will be overwrote with the same implementation in EventTarget by applyMixins
+ * @en IEventTarget implementations, they will be overwrote with the same implementation in EventTarget by applyMixins
+ * @zh IEventTarget 实现,它们将被 applyMixins 在 EventTarget 中用相同的实现覆盖。
*/
public targetOff (keyOrTarget?: string | Object | undefined): void {}
public once (type: string, callback: Function, target?: Object | undefined): Function | undefined {
diff --git a/cocos/core/assets/simple-texture.ts b/cocos/core/assets/simple-texture.ts
index 1f65ee7067..2ab906baf4 100644
--- a/cocos/core/assets/simple-texture.ts
+++ b/cocos/core/assets/simple-texture.ts
@@ -182,7 +182,8 @@ export class SimpleTexture extends TextureBase {
}
/**
- * This method is overrided by derived classes to provide GFX texture info.
+ * @en This method is overrided by derived classes to provide GFX texture info.
+ * @zh 这个方法被派生类重写以提供GFX纹理信息。
* @param presumed The presumed GFX texture info.
*/
protected _getGfxTextureCreateInfo (presumed: PresumedGFXTextureInfo): IGFXTextureInfo | null {
diff --git a/cocos/core/components/component.ts b/cocos/core/components/component.ts
index 43741e2632..fd2cb400fb 100644
--- a/cocos/core/components/component.ts
+++ b/cocos/core/components/component.ts
@@ -454,7 +454,7 @@ class Component extends CCObject {
* @en Schedules a callback function that runs only once, with a delay of 0 or larger.
* @zh 调度一个只运行一次的回调函数,可以指定 0 让回调函数在下一帧立即执行或者在一定的延时之后执行。
* @method scheduleOnce
- * @see [[Node.schedule]]
+ * @see [[schedule]]
* @param {function} callback 回调函数。
* @param {Number} delay 第一次执行前等待的时间(延时执行)。
* @example
@@ -527,10 +527,14 @@ class Component extends CCObject {
protected lateUpdate? (dt: number): void;
/**
- * `__preload` is called before every onLoad.
- * It is used to initialize the builtin components internally,
- * to avoid checking whether onLoad is called before every public method calls.
+ * @en `__preload` is called before every onLoad.
+ * It is used to initialize the builtin components internally,
+ * to avoid checking whether onLoad is called before every public method calls.
* This method should be removed if script priority is supported.
+ * @zh `__preload` 在每次onLoad之前调用。
+ * 它用于在内部初始化内置组件,
+ * 以避免在每次公有方法调用之前检查是否调用了onLoad。
+ * 如果支持脚本优先级,则应删除此方法。
* @private
*/
protected __preload? (): void;
diff --git a/cocos/core/data/class-decorator.ts b/cocos/core/data/class-decorator.ts
index 7afb2e2a8a..6602aa6ae8 100644
--- a/cocos/core/data/class-decorator.ts
+++ b/cocos/core/data/class-decorator.ts
@@ -37,8 +37,8 @@
// tslint:disable:no-empty-interface
/**
- * @en Some JavaScript decorators which can be accessed with "cc._decorator".
- * @zh 一些 JavaScript 装饰器,目前可以通过 "cc._decorator" 来访问。
+ * Some JavaScript decorators which can be accessed with "cc._decorator".
+ * 一些 JavaScript 装饰器,目前可以通过 "cc._decorator" 来访问。
* (这些 API 仍不完全稳定,有可能随着 JavaScript 装饰器的标准实现而调整)
*
* @submodule _decorator
@@ -312,26 +312,26 @@ export type SimplePropertyType = Function | string | typeof CCString | typeof CC
export type PropertyType = SimplePropertyType | SimplePropertyType[];
/**
- * cc 属性选项。
+ * @zh cc 属性选项。
*/
export interface IPropertyOptions extends IExposedAttributes {
}
/**
- * 标注属性为 cc 属性。
+ * @zh 标注属性为 cc 属性。
* @param options 选项。
*/
export function property (options?: IPropertyOptions): PropertyDecorator;
/**
- * 标注属性为 cc 属性。
+ * @zh 标注属性为 cc 属性。
* 等价于`@property({type})`。
* @param type cc 属性的类型。
*/
export function property (type: PropertyType): PropertyDecorator;
/**
- * 标注属性为 cc 属性。
+ * @zh 标注属性为 cc 属性。
* 等价于`@property()`。
*/
export function property (target: Object, propertyKey: string | symbol): void;
@@ -373,12 +373,10 @@ function createDummyDecorator (argCheckFunc) {
}
/**
- * @en
- * Makes a CCClass that inherit from component execute in edit mode.
- * By default, all components are only executed in play mode,
- * which means they will not have their callback functions executed while the Editor is in edit mode.
- * @zh
- * 允许继承自 Component 的 CCClass 在编辑器里执行。
+ * Makes a CCClass that inherit from component execute in edit mode.
+ * By default, all components are only executed in play mode,
+ * which means they will not have their callback functions executed while the Editor is in edit mode.
+ * 允许继承自 Component 的 CCClass 在编辑器里执行。
* 默认情况下,所有 Component 都只会在运行时才会执行,也就是说它们的生命周期回调不会在编辑器里触发。
*
* @method executeInEditMode
diff --git a/cocos/core/director.ts b/cocos/core/director.ts
index 297468d21e..8f91efec78 100644
--- a/cocos/core/director.ts
+++ b/cocos/core/director.ts
@@ -237,16 +237,16 @@ export class Director extends EventTarget {
public static readonly EVENT_AFTER_DRAW = 'director_after_draw';
/**
- * @en The event which will be triggered before the physics process.
- * @zh 物理过程之前所触发的事件。
+ * The event which will be triggered before the physics process.
+ * 物理过程之前所触发的事件。
* @event Director.EVENT_BEFORE_PHYSICS
* @readonly
*/
public static readonly EVENT_BEFORE_PHYSICS = 'director_before_physics';
/**
- * @en The event which will be triggered after the physics process.
- * @zh 物理过程之后所触发的事件。
+ * The event which will be triggered after the physics process.
+ * 物理过程之后所触发的事件。
* @event Director.EVENT_AFTER_PHYSICS
* @readonly
*/
diff --git a/cocos/core/geom-utils/intersect.ts b/cocos/core/geom-utils/intersect.ts
index a015205444..4100b13fc8 100644
--- a/cocos/core/geom-utils/intersect.ts
+++ b/cocos/core/geom-utils/intersect.ts
@@ -21,9 +21,7 @@ import triangle from './triangle';
// tslint:disable:no-shadowed-variable
/**
- * @en
- * ray-plane intersect
- * @zh
+ * ray-plane intersect
* 射线与平面的相交性检测。
* @param {ray} ray 射线
* @param {plane} plane 平面
@@ -43,9 +41,7 @@ const ray_plane = (function () {
})();
/**
- * @en
- * line-plane intersect
- * @zh
+ * line-plane intersect
* 线段与平面的相交性检测。
* @param {line} line 线段
* @param {plane} plane 平面
@@ -64,9 +60,7 @@ const line_plane = (function () {
// based on http://fileadmin.cs.lth.se/cs/Personal/Tomas_Akenine-Moller/raytri/
/**
- * @en
- * ray-triangle intersect
- * @zh
+ * ray-triangle intersect
* 射线与三角形的相交性检测。
* @param {ray} ray 射线
* @param {triangle} triangle 三角形
@@ -104,9 +98,7 @@ const ray_triangle = (function () {
})();
/**
- * @en
- * line-triangle intersect
- * @zh
+ * line-triangle intersect
* 线段与三角形的相交性检测。
* @param {line} line 线段
* @param {triangle} triangle 三角形
@@ -169,9 +161,7 @@ const line_triangle = (function () {
})();
/**
- * @en
- * line-quad intersect
- * @zh
+ * line-quad intersect
* 线段与四边形的相交性检测。
* @param {Vec3} p 线段的一点
* @param {Vec3} q 线段的另一点
@@ -262,9 +252,7 @@ const line_quad = (function () {
})();
/**
- * @en
- * ray-sphere intersect
- * @zh
+ * ray-sphere intersect
* 射线和球的相交性检测。
* @param {ray} ray 射线
* @param {sphere} sphere 球
@@ -293,9 +281,7 @@ const ray_sphere = (function () {
})();
/**
- * @en
- * ray-aabb intersect
- * @zh
+ * ray-aabb intersect
* 射线和轴对齐包围盒的相交性检测。
* @param {ray} ray 射线
* @param {aabb} aabb 轴对齐包围盒
@@ -323,9 +309,7 @@ const ray_aabb = (function () {
})();
/**
- * @en
- * ray-obb intersect
- * @zh
+ * ray-obb intersect
* 射线和方向包围盒的相交性检测。
* @param {ray} ray 射线
* @param {obb} obb 方向包围盒
@@ -401,9 +385,7 @@ const ray_obb = (function () {
})();
/**
- * @en
- * aabb-aabb intersect
- * @zh
+ * aabb-aabb intersect
* 轴对齐包围盒和轴对齐包围盒的相交性检测。
* @param {aabb} aabb1 轴对齐包围盒1
* @param {aabb} aabb2 轴对齐包围盒2
@@ -490,9 +472,7 @@ function getInterval (vertices: any[] | Vec3[], axis: Vec3) {
}
/**
- * @en
- * aabb-obb intersect
- * @zh
+ * aabb-obb intersect
* 轴对齐包围盒和方向包围盒的相交性检测。
* @param {aabb} aabb 轴对齐包围盒
* @param {obb} obb 方向包围盒
@@ -543,9 +523,7 @@ const aabb_obb = (function () {
})();
/**
- * @en
- * aabb-plane intersect
- * @zh
+ * aabb-plane intersect
* 轴对齐包围盒和平面的相交性检测。
* @param {aabb} aabb 轴对齐包围盒
* @param {plane} plane 平面
@@ -562,9 +540,7 @@ const aabb_plane = function (aabb: aabb, plane: plane): number {
};
/**
- * @en
- * aabb-frustum intersect, faster but has false positive corner cases
- * @zh
+ * aabb-frustum intersect, faster but has false positive corner cases
* 轴对齐包围盒和锥台相交性检测,速度快,但有错误情况。
* @param {aabb} aabb 轴对齐包围盒
* @param {frustum} frustum 锥台
@@ -582,9 +558,7 @@ const aabb_frustum = function (aabb: aabb, frustum: frustum): number {
// https://cesium.com/blog/2017/02/02/tighter-frustum-culling-and-why-you-may-want-to-disregard-it/
/**
- * @en
- * aabb-frustum intersect, handles most of the false positives correctly
- * @zh
+ * aabb-frustum intersect, handles most of the false positives correctly
* 轴对齐包围盒和锥台相交性检测,正确处理大多数错误情况。
* @param {aabb} aabb 轴对齐包围盒
* @param {frustum} frustum 锥台
@@ -634,9 +608,7 @@ const aabb_frustum_accurate = (function () {
})();
/**
- * @en
- * obb-point intersect
- * @zh
+ * obb-point intersect
* 方向包围盒和点的相交性检测。
* @param {obb} obb 方向包围盒
* @param {Vec3} point 点
@@ -653,9 +625,7 @@ const obb_point = (function () {
})();
/**
- * @en
- * obb-plane intersect
- * @zh
+ * obb-plane intersect
* 方向包围盒和平面的相交性检测。
* @param {obb} obb 方向包围盒
* @param {plane} plane 平面
@@ -679,9 +649,7 @@ const obb_plane = (function () {
})();
/**
- * @en
- * obb-frustum intersect, faster but has false positive corner cases
- * @zh
+ * obb-frustum intersect, faster but has false positive corner cases
* 方向包围盒和锥台相交性检测,速度快,但有错误情况。
* @param {obb} obb 方向包围盒
* @param {frustum} frustum 锥台
@@ -699,9 +667,7 @@ const obb_frustum = function (obb: obb, frustum: frustum): number {
// https://cesium.com/blog/2017/02/02/tighter-frustum-culling-and-why-you-may-want-to-disregard-it/
/**
- * @en
- * obb-frustum intersect, handles most of the false positives correctly
- * @zh
+ * obb-frustum intersect, handles most of the false positives correctly
* 方向包围盒和锥台相交性检测,正确处理大多数错误情况。
* @param {obb} obb 方向包围盒
* @param {frustum} frustum 锥台
@@ -757,9 +723,7 @@ const obb_frustum_accurate = (function () {
})();
/**
- * @en
- * obb-obb intersect
- * @zh
+ * obb-obb intersect
* 方向包围盒和方向包围盒的相交性检测。
* @param {obb} obb1 方向包围盒1
* @param {obb} obb2 方向包围盒2
@@ -808,11 +772,9 @@ const obb_obb = (function () {
})();
/**
- * @en
- * sphere-plane intersect, not necessarily faster than obb-plane
- * due to the length calculation of the plane normal to factor out
- * the unnomalized plane distance
- * @zh
+ * sphere-plane intersect, not necessarily faster than obb-plane
+ * due to the length calculation of the plane normal to factor out
+ * the unnomalized plane distance
* 球与平面的相交性检测。
* @param {sphere} sphere 球
* @param {plane} plane 平面
@@ -827,9 +789,7 @@ const sphere_plane = function (sphere: sphere, plane: plane): number {
};
/**
- * @en
- * sphere-frustum intersect, faster but has false positive corner cases
- * @zh
+ * sphere-frustum intersect, faster but has false positive corner cases
* 球和锥台的相交性检测,速度快,但有错误情况。
* @param {sphere} sphere 球
* @param {frustum} frustum 锥台
@@ -847,9 +807,7 @@ const sphere_frustum = function (sphere: sphere, frustum: frustum): number {
// https://stackoverflow.com/questions/20912692/view-frustum-culling-corner-cases
/**
- * @en
- * sphere-frustum intersect, handles the false positives correctly
- * @zh
+ * sphere-frustum intersect, handles the false positives correctly
* 球和锥台的相交性检测,正确处理大多数错误情况。
* @param {sphere} sphere 球
* @param {frustum} frustum 锥台
@@ -880,9 +838,7 @@ const sphere_frustum_accurate = (function () {
})();
/**
- * @en
- * sphere-sphere intersect
- * @zh
+ * sphere-sphere intersect
* 球和球的相交性检测。
* @param {sphere} sphere0 球0
* @param {sphere} sphere1 球1
@@ -894,9 +850,7 @@ const sphere_sphere = function (sphere0: sphere, sphere1: sphere): boolean {
};
/**
- * @en
- * sphere-aabb intersect
- * @zh
+ * sphere-aabb intersect
* 球和轴对齐包围盒的相交性检测。
* @param {sphere} sphere 球
* @param {aabb} aabb 轴对齐包围盒
@@ -911,9 +865,7 @@ const sphere_aabb = (function () {
})();
/**
- * @en
- * sphere-obb intersect
- * @zh
+ * sphere-obb intersect
* 球和方向包围盒的相交性检测。
* @param {sphere} sphere 球
* @param {obb} obb 方向包围盒
diff --git a/cocos/core/geom-utils/octree.ts b/cocos/core/geom-utils/octree.ts
index d65e90d3a3..6243533b4d 100644
--- a/cocos/core/geom-utils/octree.ts
+++ b/cocos/core/geom-utils/octree.ts
@@ -103,7 +103,8 @@ class OctreeBlock {
export default class Octree {
/**
- * Create sub blocks and populate them with given entries
+ * @en Create sub blocks and populate them with given entries
+ * @zh 创建子块,并用给定的条目填充它们
* @param {Vec3} worldMin - min position of the parent bounding box
* @param {Vec3} worldMax - max position of the parent bounding box
* @param {Array
* 封装用户的事件处理逻辑。
* 注意:这是一个抽象类,开发者不应该直接实例化这个类,请参考 [[create]] 。
*/
@@ -62,43 +59,43 @@ export class EventListener {
return this._onEvent;
}
/**
- * @en The type code of unknown event listener.
+ * @en The type code of unknown event listener.
* @zh 未知的事件监听器类型
*/
public static UNKNOWN = 0;
/**
- * @en The type code of one by one touch event listener.
+ * @en The type code of one by one touch event listener.
* @zh 触摸事件监听器类型,触点会一个一个得分开被派发
*/
public static TOUCH_ONE_BY_ONE = 1;
/**
- * @en The type code of all at once touch event listener.
+ * @en The type code of all at once touch event listener.
* @zh 触摸事件监听器类型,触点会被一次性全部派发
*/
public static TOUCH_ALL_AT_ONCE = 2;
/**
- * @en The type code of keyboard event listener.
+ * @en The type code of keyboard event listener.
* @zh 键盘事件监听器类型
*/
public static KEYBOARD = 3;
/**
- * @en The type code of mouse event listener.
+ * @en The type code of mouse event listener.
* @zh 鼠标事件监听器类型
*/
public static MOUSE = 4;
/**
- * @en The type code of acceleration event listener.
+ * @en The type code of acceleration event listener.
* @zh 加速器事件监听器类型
*/
public static ACCELERATION = 6;
/**
- * @en The type code of custom event listener.
+ * @en The type code of custom event listener.
* @zh 自定义事件监听器类型
*/
public static CUSTOM = 8;
@@ -112,11 +109,10 @@ export class EventListener {
};
/**
- * @en
- * Create a EventListener object with configuration including the event type, handlers and other parameters.
- * In handlers, this refer to the event listener object itself.
- * You can also pass custom parameters in the configuration object,
- * all custom parameters will be polyfilled into the event listener object and can be accessed in handlers.
+ * @en Create a EventListener object with configuration including the event type, handlers and other parameters.
+ * In handlers, this refer to the event listener object itself.
+ * You can also pass custom parameters in the configuration object,
+ * all custom parameters will be polyfilled into the event listener object and can be accessed in handlers.
* @zh 通过指定不同的 Event 对象来设置想要创建的事件监听器。
* @param {Object} argObj a json object
*/
@@ -190,23 +186,23 @@ export class EventListener {
/**
* @en
- *
- * Sets paused state for the listener
- * The paused state is only used for scene graph priority listeners.
- * `EventDispatcher::resumeAllEventListenersForTarget(node)` will set the paused state to `true`,
- * while `EventDispatcher::pauseAllEventListenersForTarget(node)` will set it to `false`.
- * @note 1) Fixed priority listeners will never get paused. If a fixed priority doesn't want to receive events,
- * call `setEnabled(false)` instead.
- * 2) In `Node`'s onEnter and onExit, the `paused state` of the listeners
- * which associated with that node will be automatically updated.
- *
+ *
+ * Sets paused state for the listener
+ * The paused state is only used for scene graph priority listeners.
+ * `EventDispatcher::resumeAllEventListenersForTarget(node)` will set the paused state to `true`,
+ * while `EventDispatcher::pauseAllEventListenersForTarget(node)` will set it to `false`.
+ * @note 1) Fixed priority listeners will never get paused. If a fixed priority doesn't want to receive events,
+ * call `setEnabled(false)` instead.
+ * 2) In `Node`'s onEnter and onExit, the `paused state` of the listeners
+ * which associated with that node will be automatically updated.
+ *
* @zh
- * *为侦听器设置暂停状态
- * 暂停状态仅用于场景图优先级侦听器。
- * `EventDispatcher :: resumeAllEventListenersForTarget(node)`将暂停状态设置为`true`,
- * 而`EventDispatcher :: pauseAllEventListenersForTarget(node)`将它设置为`false`。
- * 注意:
- * - 固定优先级侦听器永远不会被暂停。 如果固定优先级不想接收事件,改为调用`setEnabled(false)`。
+ * *为侦听器设置暂停状态
+ * 暂停状态仅用于场景图优先级侦听器。
+ * `EventDispatcher :: resumeAllEventListenersForTarget(node)`将暂停状态设置为`true`,
+ * 而`EventDispatcher :: pauseAllEventListenersForTarget(node)`将它设置为`false`。
+ * 注意:
+ * - 固定优先级侦听器永远不会被暂停。 如果固定优先级不想接收事件,改为调用`setEnabled(false)`。
* - 在“Node”的onEnter和onExit中,监听器的“暂停状态”与该节点关联的*将自动更新。
*/
public _setPaused (paused: boolean) {
@@ -214,30 +210,24 @@ export class EventListener {
}
/**
- * @en
- * Checks whether the listener is paused.
- * @zh
- * 检查侦听器是否已暂停。
+ * @en Checks whether the listener is paused.
+ * @zh 检查侦听器是否已暂停。
*/
public _isPaused () {
return this._paused;
}
/**
- * @en
- * Marks the listener was registered by EventDispatcher.
- * @zh
- * 标记监听器已由 EventDispatcher 注册。
+ * @en Marks the listener was registered by EventDispatcher.
+ * @zh 标记监听器已由 EventDispatcher 注册。
*/
public _setRegistered (registered: boolean) {
this._registered = registered;
}
/**
- * @en
- * Checks whether the listener was registered by EventDispatcher
- * @zh
- * 检查监听器是否已由 EventDispatcher 注册。
+ * @en Checks whether the listener was registered by EventDispatcher
+ * @zh 检查监听器是否已由 EventDispatcher 注册。
* @private
*/
public _isRegistered () {
@@ -245,13 +235,11 @@ export class EventListener {
}
/**
- * @en
- * Gets the type of this listener
- * note: It's different from `EventType`, e.g.
- * TouchEvent has two kinds of event listeners - EventListenerOneByOne, EventListenerAllAtOnce
- * @zh
- * 获取此侦听器的类型
- * 注意:它与`EventType`不同,例如
+ * @en Gets the type of this listener
+ * note: It's different from `EventType`, e.g.
+ * TouchEvent has two kinds of event listeners - EventListenerOneByOne, EventListenerAllAtOnce
+ * @zh 获取此侦听器的类型
+ * 注意:它与`EventType`不同,例如
* TouchEvent 有两种事件监听器 - EventListenerOneByOne,EventListenerAllAtOnce
*/
public _getType () {
@@ -259,11 +247,9 @@ export class EventListener {
}
/**
- * @en
- * Gets the listener ID of this listener
- * When event is being dispatched, listener ID is used as key for searching listeners according to event type.
- * @zh
- * 获取此侦听器的侦听器 ID。
+ * @en Gets the listener ID of this listener
+ * When event is being dispatched, listener ID is used as key for searching listeners according to event type.
+ * @zh 获取此侦听器的侦听器 ID。
* 调度事件时,侦听器 ID 用作根据事件类型搜索侦听器的键。
*/
public _getListenerID () {
@@ -271,13 +257,11 @@ export class EventListener {
}
/**
- * @en
- * Sets the fixed priority for this listener
- * note: This method is only used for `fixed priority listeners`,
- * it needs to access a non-zero value. 0 is reserved for scene graph priority listeners
- * @zh
- * 设置此侦听器的固定优先级。
- * 注意:此方法仅用于“固定优先级侦听器”,
+ * @en Sets the fixed priority for this listener
+ * note: This method is only used for `fixed priority listeners`,
+ * it needs to access a non-zero value. 0 is reserved for scene graph priority listeners
+ * @zh 设置此侦听器的固定优先级。
+ * 注意:此方法仅用于“固定优先级侦听器”,
* 它需要访问非零值。 0保留给场景图优先级侦听器。
*/
public _setFixedPriority (fixedPriority: number) {
@@ -285,10 +269,8 @@ export class EventListener {
}
/**
- * @en
- * Gets the fixed priority of this listener
- * @zh
- * 获取此侦听器的固定优先级。
+ * @en Gets the fixed priority of this listener
+ * @zh 获取此侦听器的固定优先级。
* @return 如果它是场景图优先级侦听器则返回 0 ,则对于固定优先级侦听器则不为零
*/
public _getFixedPriority () {
@@ -296,10 +278,8 @@ export class EventListener {
}
/**
- * @en
- * Sets scene graph priority for this listener
- * @zh
- * 设置此侦听器的场景图优先级。
+ * @en Sets scene graph priority for this listener
+ * @zh 设置此侦听器的场景图优先级。
* @param {Node} node
*/
public _setSceneGraphPriority (node: any) {
@@ -308,10 +288,8 @@ export class EventListener {
}
/**
- * @en
- * Gets scene graph priority of this listener
- * @zh
- * 获取此侦听器的场景图优先级。
+ * @en Gets scene graph priority of this listener
+ * @zh 获取此侦听器的场景图优先级。
* @return 如果它是固定优先级侦听器,则为场景图优先级侦听器非 null 。
*/
public _getSceneGraphPriority () {
@@ -319,7 +297,7 @@ export class EventListener {
}
/**
- * @en Checks whether the listener is available.
+ * @en Checks whether the listener is available.
* @zh 检测监听器是否有效
*/
public checkAvailable () {
@@ -327,7 +305,7 @@ export class EventListener {
}
/**
- * @en Clones the listener, its subclasses have to override this method.
+ * @en Clones the listener, its subclasses have to override this method.
* @zh 克隆监听器,它的子类必须重写此方法。
*/
public clone (): EventListener | null {
@@ -335,23 +313,25 @@ export class EventListener {
}
/**
- * @en Enables or disables the listener
- * note: Only listeners with `enabled` state will be able to receive events.
- * When an listener was initialized, it's enabled by default.
- * An event listener can receive events when it is enabled and is not paused.
- * paused state is always false when it is a fixed priority listener.
- * @zh 启用或禁用监听器。
- * 注意:只有处于“启用”状态的侦听器才能接收事件。
- * 初始化侦听器时,默认情况下启用它。
- * 事件侦听器可以在启用且未暂停时接收事件。
- * 当固定优先级侦听器时,暂停状态始终为false。
+ * @en
+ * Enables or disables the listener
+ * note: Only listeners with `enabled` state will be able to receive events.
+ * When an listener was initialized, it's enabled by default.
+ * An event listener can receive events when it is enabled and is not paused.
+ * paused state is always false when it is a fixed priority listener.
+ * @zh
+ * 启用或禁用监听器。
+ * 注意:只有处于“启用”状态的侦听器才能接收事件。
+ * 初始化侦听器时,默认情况下启用它。
+ * 事件侦听器可以在启用且未暂停时接收事件。
+ * 当固定优先级侦听器时,暂停状态始终为false。
*/
public setEnabled (enabled: boolean) {
this._isEnabled = enabled;
}
/**
- * @en Checks whether the listener is enabled
+ * @en Checks whether the listener is enabled
* @zh 检查监听器是否可用。
*/
public isEnabled () {
diff --git a/cocos/core/platform/event-manager/system-event.ts b/cocos/core/platform/event-manager/system-event.ts
index 469e0cd973..9add3bf59b 100644
--- a/cocos/core/platform/event-manager/system-event.ts
+++ b/cocos/core/platform/event-manager/system-event.ts
@@ -36,31 +36,32 @@ import eventManager from './event-manager';
import inputManager from './input-manager';
import { Touch } from './touch';
-/**
- * @en
- * The System event, it currently supports keyboard events and accelerometer events.
- * You can get the SystemEvent instance with cc.systemEvent.
- * example:
- * ```
- * cc.systemEvent.on(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
- * cc.systemEvent.off(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
- * ```
- * @zh
- * 系统事件,它目前支持按键事件和重力感应事件。
- * 你可以通过 cc.systemEvent 获取到 SystemEvent 的实例。
- * @example
- * ```
- * cc.systemEvent.on(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
- * cc.systemEvent.off(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
- * ```
- * @class SystemEvent
- * @extends EventTarget
- */
-
let keyboardListener: EventListener | null = null;
let accelerationListener: EventListener | null = null;
let touchListener: EventListener | null = null;
let mouseListener: EventListener | null = null;
+
+/**
+* @en
+* The System event, it currently supports keyboard events and accelerometer events.
+* You can get the SystemEvent instance with cc.systemEvent.
+* @example
+* ```
+* cc.systemEvent.on(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
+* cc.systemEvent.off(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
+* ```
+* @zh
+* 系统事件,它目前支持按键事件和重力感应事件。
+* 你可以通过 cc.systemEvent 获取到 SystemEvent 的实例。
+* @example
+* ```
+* cc.systemEvent.on(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
+* cc.systemEvent.off(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
+* ```
+* @class SystemEvent
+* @extends EventTarget
+*/
+
export class SystemEvent extends EventTarget {
public static EventType = SystemEventType;
constructor () {
diff --git a/cocos/core/primitive/circle.ts b/cocos/core/primitive/circle.ts
index 0fd7990a72..63925c9406 100644
--- a/cocos/core/primitive/circle.ts
+++ b/cocos/core/primitive/circle.ts
@@ -26,6 +26,7 @@ function applyDefaultCircleOptions (options?: RecursivePartial):
}
/**
+ * @en
* Generate a circle with radius 1, centered at origin.
* @zh
* 生成一个圆,其半径是单位1,中心点在原点。
diff --git a/cocos/core/scene-graph/base-node.ts b/cocos/core/scene-graph/base-node.ts
index 2d60599f07..08d94d8508 100644
--- a/cocos/core/scene-graph/base-node.ts
+++ b/cocos/core/scene-graph/base-node.ts
@@ -87,15 +87,18 @@ function getConstructor (typeOrClassName: string | Function): Function | null {
@ccclass('cc._BaseNode')
export class BaseNode extends CCObject implements IBaseNode, ISchedulable {
/**
- * Gets all components attached to this node.
+ * @en Gets all components attached to this node.
+ * @zh 获取附加到此节点的所有组件。
*/
get components (): ReadonlyArray {
return this._components;
}
/**
- * If true, the node is an persist node which won't be destroyed during scene transition.
+ * @en If true, the node is an persist node which won't be destroyed during scene transition.
* If false, the node will be destroyed automatically when loading a new scene. Default is false.
+ * @zh 如果为true,则该节点是一个常驻节点,不会在场景转换期间被销毁。
+ * 如果为false,节点将在加载新场景时自动销毁。默认为false。
* @property _persistNode
* @type {Boolean}
* @default false
@@ -573,7 +576,9 @@ export class BaseNode extends CCObject implements IBaseNode, ISchedulable {
* @zh
* 插入子节点到指定位置
* @param child - the child node to be inserted
+ * 要插入的子节点
* @param siblingIndex - the sibling index to place the child in
+ * 用于放置子节点的同级索引
* @example
* ```
* node.insertChild(child, 2);
@@ -761,6 +766,7 @@ export class BaseNode extends CCObject implements IBaseNode, ISchedulable {
* @zh
* 移除节点中指定的子节点。
* @param child - The child node which will be removed.
+ * 将被移除的子节点
* @example
* ```
* node.removeChild(newNode);
@@ -799,6 +805,7 @@ export class BaseNode extends CCObject implements IBaseNode, ISchedulable {
* @en Is this node a child of the given node?
* @zh 是否是指定节点的子节点?
* @return True if this node is a child, deep child or identical to the given node.
+ * @return 如果此节点是子节点、深度子节点或与给定节点相同,则为True。
* @example
* ```
* node.isChildOf(newNode);
@@ -1046,6 +1053,7 @@ export class BaseNode extends CCObject implements IBaseNode, ISchedulable {
* 删除节点上的指定组件,传入参数可以是一个组件构造函数或组件名,也可以是已经获得的组件引用。
* 如果你已经获得组件引用,你也可以直接调用 component.destroy()
* @deprecated please destroy the component to remove it.
+ * 请销毁组件以移除它。
* @example
* ```
* node.removeComponent(cc.SpriteComponent);
diff --git a/cocos/core/scene-graph/layers.ts b/cocos/core/scene-graph/layers.ts
index 0b418e176e..d6740d0e9d 100644
--- a/cocos/core/scene-graph/layers.ts
+++ b/cocos/core/scene-graph/layers.ts
@@ -82,8 +82,7 @@ export class Layers {
}
/**
- * @zh
- * 添加一个新层,用户可编辑 0 - 19 位为用户自定义层
+ * @zh 添加一个新层,用户可编辑 0 - 19 位为用户自定义层
* @param name 层名字
* @param bitNum 层序号
*/
diff --git a/cocos/core/scene-graph/node-activator.ts b/cocos/core/scene-graph/node-activator.ts
index 4a91dec0bd..ce6ba8d2cc 100644
--- a/cocos/core/scene-graph/node-activator.ts
+++ b/cocos/core/scene-graph/node-activator.ts
@@ -137,7 +137,8 @@ function _onLoadInEditor (comp) {
}
/**
- * The class used to perform activating and deactivating operations of node and component.
+ * @en The class used to perform activating and deactivating operations of node and component.
+ * @zh 用于执行节点和组件的激活和停用操作的类。
*/
export default class NodeActivator {
public resetComp: any;
diff --git a/cocos/ui/components/graphics-component.ts b/cocos/ui/components/graphics-component.ts
index 81d7ff1e86..18febbc88b 100644
--- a/cocos/ui/components/graphics-component.ts
+++ b/cocos/ui/components/graphics-component.ts
@@ -464,7 +464,7 @@ export class GraphicsComponent extends UIRenderComponent {
/**
* @zh
- * 辅助材质实例化。可用于只取数据而无实体情况下渲染使用。特殊情况可参考:[[_instanceMaterial]]
+ * 辅助材质实例化。可用于只取数据而无实体情况下渲染使用。特殊情况可参考:[[instanceMaterial]]
*/
public helpInstanceMaterial () {
let mat: Material | null = null;
diff --git a/cocos/ui/components/rich-text-component.ts b/cocos/ui/components/rich-text-component.ts
index 0e68271088..1cf134d428 100644
--- a/cocos/ui/components/rich-text-component.ts
+++ b/cocos/ui/components/rich-text-component.ts
@@ -73,8 +73,7 @@ function debounce (func: Function, wait: number, immediate?: boolean) {
}
/**
- * @zh
- * 富文本池。
+ * 富文本池。
*/
const pool = new Pool((labelSeg: ILabelSegment) => {
if (CC_EDITOR) {