Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3.8.5] Add default constructor for classes #17746

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

dumganhar
Copy link
Contributor

Re: #17715

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

Copy link

👍 Package size ⤵ -1473 bytes, old: 5446736, new: 5445263

Interface Check Report

! WARNING this pull request has changed these public interfaces:

@@ -4579,8 +4579,9 @@
      * @en The skeleton asset. It stores the path related to [[SkinnedMeshRenderer.skinningRoot]] of all bones and its bind pose matrix.
      * @zh 骨骼资源。骨骼资源记录了每个关节(相对于 [[SkinnedMeshRenderer.skinningRoot]])的路径以及它的绑定姿势矩阵。
      */
     export class Skeleton extends Asset {
+        constructor();
         /**
          * @en The path of all bones, the length always equals the length of [[bindposes]]
          * @zh 所有关节的路径。该数组的长度始终与 [[bindposes]] 的长度相同。
          */
@@ -5361,8 +5362,9 @@
          * @en Source skinning model components, containing all the data to be batched.
          * @zh 合批前的子蒙皮模型数组,最主要的数据来源。
          */
         units: SkinnedMeshUnit[];
+        constructor();
         get mesh(): Mesh | null;
         set mesh(val: Mesh | null);
         get skeleton(): Skeleton | null;
         set skeleton(val: Skeleton | null);
@@ -5589,8 +5591,9 @@
         protected _sourceCamera: Camera | null;
         protected _probe: renderer.scene.ReflectionProbe | null;
         protected _previewSphere: Node | null;
         protected _previewPlane: Node | null;
+        constructor();
         /**
          * @en
          * Gets or sets the size of the box
          * @zh
@@ -7479,8 +7482,9 @@
         static AudioType: typeof __private._pal_audio_type__AudioType;
         protected _duration: number;
         protected _loadMode: __private._pal_audio_type__AudioType;
         protected _meta: __private._cocos_audio_audio_clip__AudioMeta | null;
+        constructor();
         destroy(): boolean;
         /**
          * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
          */
@@ -7558,8 +7562,9 @@
         protected _player: __private._pal_audio__AudioPlayer | null;
         protected _loop: boolean;
         protected _playOnAwake: boolean;
         protected _volume: number;
+        constructor();
         /**
          * @en
          * The default AudioClip to be played for this audio source.
          * @zh
@@ -28428,9 +28433,9 @@
          * 此资源的基础资源(如果有)。 此属性可用于访问与资源相关的其他详细信息或功能。<br>
          * 如果`_native`可用,则此属性将由加载器初始化。
          */
         get nativeAsset(): any;
-        constructor(...args: ConstructorParameters<typeof CCObject>);
+        constructor(name?: string);
         /**
          * @en
          * Returns the string representation of the object.<br>
          * The `Asset` object overrides the `toString()` method of the `Object` object.<br>
@@ -46039,8 +46044,9 @@
      * @zh 运动轨迹,用于游戏对象的运动轨迹上实现拖尾渐隐效果。
      */
     export class MotionStreak extends UIRenderer {
         static Point: typeof __private._cocos_particle_2d_motion_streak_2d__Point;
+        constructor();
         /**
          * @en Preview the trailing effect in editor mode.
          * @zh 在编辑器模式下预览拖尾效果。
          */
@@ -53577,8 +53583,9 @@
      * @en Terrain info
      * @zh 地形信息
      */
     export class TerrainInfo {
+        constructor();
         /**
          * @en tile size
          * @zh 栅格大小
          */
@@ -54263,8 +54270,9 @@
         protected _enableCulling: boolean;
         get enableCulling(): boolean;
         set enableCulling(value: boolean);
         protected cleanupImageCache: boolean;
+        constructor();
         /**
          * @en Gets the map size.
          * @zh 获取地图大小。
          * @method getMapSize
@@ -54396,8 +54404,9 @@
      * @extends Asset
      *
      */
     export class TiledMapAsset extends Asset {
+        constructor();
         tmxXmlStr: string;
         tsxFiles: TextAsset[];
         tsxFileNames: string[];
         /**
@@ -54884,8 +54893,9 @@
      * @extends Component
      */
     export class TiledObjectGroup extends Component {
         protected _premultiplyAlpha: boolean;
+        constructor();
         get premultiplyAlpha(): boolean;
         set premultiplyAlpha(value: boolean);
         /**
          * @en Offset position of child objects.
@@ -58463,8 +58473,9 @@
         protected _stayOnBottom: boolean;
         protected _keepAspectRatio: boolean;
         protected _impl: __private._cocos_video_video_player_impl_web__VideoPlayerImplWeb | null;
         protected _cachedCurrentTime: number;
+        constructor();
         /**
          * @en
          * The resource type of video player, REMOTE for remote url and LOCAL for local file path.
          * @zh
@@ -58675,8 +58686,9 @@
          * @en WebView event type.
          * @zh 网页视图事件类型。
          */
         static EventType: typeof __private._cocos_web_view_web_view_enums__WebViewEventType;
+        constructor();
         /**
          * @en
          * A given URL to be loaded by the WebView, it should have a http or https prefix.
          * @zh
@@ -67882,8 +67894,9 @@
          * @zh
          * 本模块用于在粒子生命周期内对颜色进行改变,可以修改模块下的颜色渐变条来查看粒子颜色渐变效果。
          */
         export class _cocos_particle_animator_color_overtime__default extends _cocos_particle_particle__ParticleModuleBase {
+            constructor();
             _enable: boolean;
             /**
              * @en Enable or disable this module.
              * @zh 是否启用。
@@ -68058,8 +68071,9 @@
          * 打开 separateAxes 就能够修改粒子在三个轴方向的大小(z轴大小对公告板粒子无效)
          * 每个轴上的粒子大小都是可以用曲线来进行编辑,修改曲线就能够看到粒子大小变化的效果了。
          */
         export class _cocos_particle_animator_size_overtime__default extends _cocos_particle_particle__ParticleModuleBase {
+            constructor();
             _enable: boolean;
             /**
              * @en Enable this module or not.
              * @zh 是否启用。
@@ -68304,8 +68318,9 @@
          * 打开 separateAxes 就能够修改粒子在三个轴方向的旋转角速度大小。
          * 每个轴上的旋转角速度都是可以用曲线来进行编辑,修改曲线就能够看到粒子受力变化的效果了。
          */
         export class _cocos_particle_animator_rotation_overtime__default extends _cocos_particle_particle__ParticleModuleBase {
+            constructor();
             _enable: boolean;
             /**
              * @en Enable this module or not.
              * @zh 是否启用。
@@ -68349,8 +68364,9 @@
          * @zh
          * 这个模块用于播放粒子纹理带的纹理帧动画。
          */
         export class _cocos_particle_animator_texture_animation__default extends _cocos_particle_particle__ParticleModuleBase {
+            constructor();
             /**
              * @en Enable this module or not.
              * @zh 是否启用。
              */
@@ -68440,8 +68456,9 @@
          * @zh
          * 为粒子添加噪声是创建有趣方案和效果的简单有效方法。
          */
         export class _cocos_particle_animator_noise_module__NoiseModule extends _cocos_particle_particle__ParticleModuleBase {
+            constructor();
             _enable: boolean;
             /**
              * @en Enable this module or not.
              * @zh 是否启用。

@longchuan
Copy link
Contributor

这些完全不是重点,先把功能做好行吧

@dumganhar dumganhar marked this pull request as draft October 20, 2024 10:22
@dumganhar dumganhar marked this pull request as ready for review November 12, 2024 05:49
@minggo minggo merged commit 01954f2 into cocos:v3.8.5 Nov 13, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants