Skip to content

Commit

Permalink
change reset order
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e committed Oct 17, 2024
1 parent 70bcfcd commit fbebb59
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions cocos/gfx/base/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1004,20 +1004,20 @@ export class Color {
return this;
}

public reset (): void {
this.x = 0;
this.y = 0;
this.z = 0;
this.w = 0;
}

public set (x: number, y: number, z: number, w: number): Color {
this.x = x;
this.y = y;
this.z = z;
this.w = w;
return this;
}

public reset (): void {
this.x = 0;
this.y = 0;
this.z = 0;
this.w = 0;
}
}

export class MarkerInfo {
Expand Down
14 changes: 7 additions & 7 deletions native/tools/gfx-define-generator/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,6 @@ for (const name of Object.keys(structMap)) {
}

if (name === 'Color') {
output += `\n`;
output += ` public reset (): void {\n`;
output += ` this.x = 0;\n`;
output += ` this.y = 0;\n`;
output += ` this.z = 0;\n`;
output += ` this.w = 0;\n`;
output += ` }\n`;
output += `\n`;
output += ` public set (x: number, y: number, z: number, w: number): Color {\n`;
output += ` this.x = x;\n`;
Expand All @@ -337,6 +330,13 @@ for (const name of Object.keys(structMap)) {
output += ` this.w = w;\n`;
output += ` return this;\n`;
output += ` }\n`;
output += `\n`;
output += ` public reset (): void {\n`;
output += ` this.x = 0;\n`;
output += ` this.y = 0;\n`;
output += ` this.z = 0;\n`;
output += ` this.w = 0;\n`;
output += ` }\n`;
}

output += `}\n\n`;
Expand Down

0 comments on commit fbebb59

Please sign in to comment.