Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Jan 3, 2025
1 parent c8d5111 commit b7dcbd6
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 29 deletions.
2 changes: 1 addition & 1 deletion cocos/2d/assets/font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { cclegacy } from '../../core';
*/
@ccclass('cc.Font')
export class Font extends Asset {
constructor (name = '') {
constructor (name?: string) {
super(name);
}
}
Expand Down
4 changes: 2 additions & 2 deletions cocos/2d/assets/sprite-atlas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export class SpriteAtlas extends Asset {
@editable
public spriteFrames: ISpriteFrameList = js.createMap();

constructor () {
super();
constructor (name?: string) {
super(name);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cocos/2d/assets/sprite-frame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cocos/3d/assets/mesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ export class Mesh extends Asset {

private _jointBufferIndices: number[] | null = null;

constructor () {
super();
constructor (name?: string) {
super(name);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cocos/3d/assets/skeleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export class Skeleton extends Asset {

private _invBindposes: Mat4[] | null = null;

constructor () {
super();
constructor (name?: string) {
super(name);
}

/**
Expand Down
4 changes: 4 additions & 0 deletions cocos/animation/animation-clip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ export class AnimationClip extends Asset {
@serializable
public enableTrsBlending = false;

constructor (name?: string) {
super(name);
}

/**
* @zh 动画的周期。
* @en Animation duration.
Expand Down
2 changes: 1 addition & 1 deletion cocos/asset/assets/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export class Asset extends Eventify(CCObject) {
return this._file;
}

constructor (name = '') {
constructor (name?: string) {
super(name);

Object.defineProperty(this, '_uuid', {
Expand Down
4 changes: 2 additions & 2 deletions cocos/asset/assets/buffer-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cocos/asset/assets/effect-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ export class EffectAsset extends Asset {
@editorOnly
public hideInEditor = false;

constructor () {
super();
constructor (name?: string) {
super(name);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cocos/asset/assets/json-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export default class JsonAsset extends Asset {
@editable
public json: Record<string, any> | null = null;

constructor () {
super();
constructor (name?: string) {
super(name);
}
}

Expand Down
4 changes: 2 additions & 2 deletions cocos/asset/assets/material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export class Material extends Asset {
*/
protected _hash = 0;

constructor () {
super();
constructor (name?: string) {
super(name);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions cocos/asset/assets/scene-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions cocos/asset/assets/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { cclegacy } from '../../core';
*/
@ccclass('cc.Script')
export class Script extends Asset {
constructor (name = '') {
constructor (name?: string) {
super(name);
}
}
Expand All @@ -45,7 +45,7 @@ cclegacy._Script = Script;
*/
@ccclass('cc.JavaScript')
export class JavaScript extends Script {
constructor (name = '') {
constructor (name?: string) {
super(name);
}
}
Expand All @@ -57,7 +57,7 @@ cclegacy._JavaScript = JavaScript;
*/
@ccclass('cc.TypeScript')
export class TypeScript extends Script {
constructor (name = '') {
constructor (name?: string) {
super(name);
}
}
Expand Down
2 changes: 1 addition & 1 deletion cocos/asset/assets/simple-texture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class SimpleTexture extends TextureBase {
*/
protected _maxLevel = 1000;

constructor (name = '') {
constructor (name?: string) {
super(name);
}

Expand Down
2 changes: 1 addition & 1 deletion cocos/asset/assets/texture-2d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export interface ITexture2DCreateInfo {
*/
@ccclass('cc.Texture2D')
export class Texture2D extends SimpleTexture {
constructor (name = '') {
constructor (name?: string) {
super(name);
}

Expand Down
2 changes: 1 addition & 1 deletion cocos/asset/assets/texture-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cocos/audio/audio-clip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export class AudioClip extends Asset {

private _player: AudioPlayer | null = null;

constructor () {
super();
constructor (name?: string) {
super(name);
}

public destroy (): boolean {
Expand Down
2 changes: 1 addition & 1 deletion cocos/particle-2d/particle-asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1 change: 1 addition & 0 deletions cocos/rendering/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b7dcbd6

Please sign in to comment.