diff --git a/cocos/2d/assets/font.ts b/cocos/2d/assets/font.ts index 493e06d7169..7766296a212 100644 --- a/cocos/2d/assets/font.ts +++ b/cocos/2d/assets/font.ts @@ -33,7 +33,7 @@ import { cclegacy } from '../../core'; */ @ccclass('cc.Font') export class Font extends Asset { - constructor (name = '') { + constructor (name?: string) { super(name); } } diff --git a/cocos/2d/assets/sprite-atlas.ts b/cocos/2d/assets/sprite-atlas.ts index 50da5bdb556..0cdd2caad42 100644 --- a/cocos/2d/assets/sprite-atlas.ts +++ b/cocos/2d/assets/sprite-atlas.ts @@ -55,8 +55,8 @@ export class SpriteAtlas extends Asset { @editable public spriteFrames: ISpriteFrameList = js.createMap(); - constructor () { - super(); + constructor (name?: string) { + super(name); } /** diff --git a/cocos/2d/assets/sprite-frame.ts b/cocos/2d/assets/sprite-frame.ts index b2a744e1fda..fa048f9dbf1 100644 --- a/cocos/2d/assets/sprite-frame.ts +++ b/cocos/2d/assets/sprite-frame.ts @@ -643,8 +643,8 @@ export class SpriteFrame extends Asset { protected _minPos = v3(); protected _maxPos = v3(); - constructor () { - super(); + constructor (name?: string) { + super(name); if (EDITOR) { // Atlas asset uuid diff --git a/cocos/3d/assets/mesh.ts b/cocos/3d/assets/mesh.ts index 7b63aa9732e..fe80a6a9c69 100644 --- a/cocos/3d/assets/mesh.ts +++ b/cocos/3d/assets/mesh.ts @@ -380,8 +380,8 @@ export class Mesh extends Asset { private _jointBufferIndices: number[] | null = null; - constructor () { - super(); + constructor (name?: string) { + super(name); } /** diff --git a/cocos/3d/assets/skeleton.ts b/cocos/3d/assets/skeleton.ts index 22f02cc3545..8f7812bf817 100644 --- a/cocos/3d/assets/skeleton.ts +++ b/cocos/3d/assets/skeleton.ts @@ -44,8 +44,8 @@ export class Skeleton extends Asset { private _invBindposes: Mat4[] | null = null; - constructor () { - super(); + constructor (name?: string) { + super(name); } /** diff --git a/cocos/animation/animation-clip.ts b/cocos/animation/animation-clip.ts index f09feb96017..ccc30680773 100644 --- a/cocos/animation/animation-clip.ts +++ b/cocos/animation/animation-clip.ts @@ -155,6 +155,10 @@ export class AnimationClip extends Asset { @serializable public enableTrsBlending = false; + constructor (name?: string) { + super(name); + } + /** * @zh 动画的周期。 * @en Animation duration. diff --git a/cocos/asset/assets/asset.ts b/cocos/asset/assets/asset.ts index 312f4ee0721..f530a66184e 100644 --- a/cocos/asset/assets/asset.ts +++ b/cocos/asset/assets/asset.ts @@ -187,7 +187,7 @@ export class Asset extends Eventify(CCObject) { return this._file; } - constructor (name = '') { + constructor (name?: string) { super(name); Object.defineProperty(this, '_uuid', { diff --git a/cocos/asset/assets/buffer-asset.ts b/cocos/asset/assets/buffer-asset.ts index 0691978c249..31ac44c1c70 100644 --- a/cocos/asset/assets/buffer-asset.ts +++ b/cocos/asset/assets/buffer-asset.ts @@ -37,8 +37,8 @@ import { Asset } from './asset'; export class BufferAsset extends Asset { private _buffer: ArrayBuffer | null = null; - constructor () { - super(); + constructor (name?: string) { + super(name); } /** diff --git a/cocos/asset/assets/effect-asset.ts b/cocos/asset/assets/effect-asset.ts index b7caab042b5..e5cbe940ade 100644 --- a/cocos/asset/assets/effect-asset.ts +++ b/cocos/asset/assets/effect-asset.ts @@ -325,8 +325,8 @@ export class EffectAsset extends Asset { @editorOnly public hideInEditor = false; - constructor () { - super(); + constructor (name?: string) { + super(name); } /** diff --git a/cocos/asset/assets/json-asset.ts b/cocos/asset/assets/json-asset.ts index 740eaec323c..bf26280ebce 100644 --- a/cocos/asset/assets/json-asset.ts +++ b/cocos/asset/assets/json-asset.ts @@ -41,8 +41,8 @@ export default class JsonAsset extends Asset { @editable public json: Record | null = null; - constructor () { - super(); + constructor (name?: string) { + super(name); } } diff --git a/cocos/asset/assets/material.ts b/cocos/asset/assets/material.ts index 8badc7a2279..7b26f4b3f8a 100644 --- a/cocos/asset/assets/material.ts +++ b/cocos/asset/assets/material.ts @@ -139,8 +139,8 @@ export class Material extends Asset { */ protected _hash = 0; - constructor () { - super(); + constructor (name?: string) { + super(name); } /** diff --git a/cocos/asset/assets/scene-asset.ts b/cocos/asset/assets/scene-asset.ts index 8148775dc3f..6f6e7f20d39 100644 --- a/cocos/asset/assets/scene-asset.ts +++ b/cocos/asset/assets/scene-asset.ts @@ -43,8 +43,8 @@ export class SceneAsset extends Asset { @serializable public scene: Scene | null = null; - constructor () { - super(); + constructor (name?: string) { + super(name); } public initDefault (uuid?: string): void { diff --git a/cocos/asset/assets/scripts.ts b/cocos/asset/assets/scripts.ts index e5f40e844b6..449c1dab58b 100644 --- a/cocos/asset/assets/scripts.ts +++ b/cocos/asset/assets/scripts.ts @@ -33,7 +33,7 @@ import { cclegacy } from '../../core'; */ @ccclass('cc.Script') export class Script extends Asset { - constructor (name = '') { + constructor (name?: string) { super(name); } } @@ -45,7 +45,7 @@ cclegacy._Script = Script; */ @ccclass('cc.JavaScript') export class JavaScript extends Script { - constructor (name = '') { + constructor (name?: string) { super(name); } } @@ -57,7 +57,7 @@ cclegacy._JavaScript = JavaScript; */ @ccclass('cc.TypeScript') export class TypeScript extends Script { - constructor (name = '') { + constructor (name?: string) { super(name); } } diff --git a/cocos/asset/assets/simple-texture.ts b/cocos/asset/assets/simple-texture.ts index d37dbd357f6..34bf0a44b57 100644 --- a/cocos/asset/assets/simple-texture.ts +++ b/cocos/asset/assets/simple-texture.ts @@ -81,7 +81,7 @@ export class SimpleTexture extends TextureBase { */ protected _maxLevel = 1000; - constructor (name = '') { + constructor (name?: string) { super(name); } diff --git a/cocos/asset/assets/texture-2d.ts b/cocos/asset/assets/texture-2d.ts index 9f6e20fc259..7b575417149 100644 --- a/cocos/asset/assets/texture-2d.ts +++ b/cocos/asset/assets/texture-2d.ts @@ -83,7 +83,7 @@ export interface ITexture2DCreateInfo { */ @ccclass('cc.Texture2D') export class Texture2D extends SimpleTexture { - constructor (name = '') { + constructor (name?: string) { super(name); } diff --git a/cocos/asset/assets/texture-base.ts b/cocos/asset/assets/texture-base.ts index 94a379077ba..f3ee301b0d6 100644 --- a/cocos/asset/assets/texture-base.ts +++ b/cocos/asset/assets/texture-base.ts @@ -147,7 +147,7 @@ export class TextureBase extends Asset { private _textureHash = 0; - constructor (name = '') { + constructor (name?: string) { super(name); // Id for generate hash in material diff --git a/cocos/audio/audio-clip.ts b/cocos/audio/audio-clip.ts index 28a6e2733c3..82e87c044ae 100644 --- a/cocos/audio/audio-clip.ts +++ b/cocos/audio/audio-clip.ts @@ -60,8 +60,8 @@ export class AudioClip extends Asset { private _player: AudioPlayer | null = null; - constructor () { - super(); + constructor (name?: string) { + super(name); } public destroy (): boolean { diff --git a/cocos/particle-2d/particle-asset.ts b/cocos/particle-2d/particle-asset.ts index 9b75d43b85d..ba345761451 100644 --- a/cocos/particle-2d/particle-asset.ts +++ b/cocos/particle-2d/particle-asset.ts @@ -39,7 +39,7 @@ const { ccclass, serializable, editable } = _decorator; export class ParticleAsset extends Asset { @serializable @editable - public spriteFrame: SpriteFrame | null= null; + public spriteFrame: SpriteFrame | null = null; } cclegacy.ParticleAsset = ParticleAsset; diff --git a/cocos/rendering/define.ts b/cocos/rendering/define.ts index 99e28960470..455692869da 100644 --- a/cocos/rendering/define.ts +++ b/cocos/rendering/define.ts @@ -677,6 +677,7 @@ localDescriptorSetLayout.bindings[UBOMorph.BINDING] = UBOMorph.DESCRIPTOR; // UI local uniform UBO export class UBOUILocal { // pre one vec4 + private constructor () {} public static readonly NAME = 'CCUILocal'; public static readonly BINDING = ModelLocalBindings.UBO_UI_LOCAL; public static readonly DESCRIPTOR = new DescriptorSetLayoutBinding(UBOUILocal.BINDING, DescriptorType.DYNAMIC_UNIFORM_BUFFER, 1, ShaderStageFlagBit.VERTEX);