Skip to content

Commit

Permalink
refine code style (cocos#15947)
Browse files Browse the repository at this point in the history
  • Loading branch information
2youyou2 authored Aug 14, 2023
1 parent ceb15e9 commit d007151
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions cocos/rendering/post-process/components/blit-screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { PostProcessSetting } from './post-process-setting';
@ccclass('cc.BlitScreenMaterial')
class BlitScreenMaterial {
@property(Material)
_material: Material | undefined;
protected _material: Material | undefined;

@property(Material)
get material (): Material | undefined {
Expand All @@ -28,7 +28,7 @@ class BlitScreenMaterial {
@executeInEditMode
export class BlitScreen extends PostProcessSetting {
@property(Material)
_activeMaterials: Material[] = [];
protected _activeMaterials: Material[] = [];
@property({ type: Material, visible: false })
get activeMaterials (): Material[] {
return this._activeMaterials;
Expand All @@ -47,7 +47,7 @@ export class BlitScreen extends PostProcessSetting {
}

@property(BlitScreenMaterial)
_materials: BlitScreenMaterial[] = [];
protected _materials: BlitScreenMaterial[] = [];

@property(BlitScreenMaterial)
get materials (): BlitScreenMaterial[] {
Expand All @@ -60,10 +60,10 @@ export class BlitScreen extends PostProcessSetting {
globalThis.cce.Engine.repaintInEditMode();
}, 50);
}
this.updateActiveMateirals();
this.updateActiveMaterials();
}

updateActiveMateirals (): void {
updateActiveMaterials (): void {
const materials = this._materials;
this._activeMaterials.length = 0;
for (let i = 0; i < materials.length; i++) {
Expand All @@ -75,6 +75,6 @@ export class BlitScreen extends PostProcessSetting {
}

onLoad (): void {
this.updateActiveMateirals();
this.updateActiveMaterials();
}
}
4 changes: 2 additions & 2 deletions cocos/rendering/post-process/components/fsr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { PostProcessSetting } from './post-process-setting';
@executeInEditMode
export class FSR extends PostProcessSetting {
@serializable
_sharpness = 0.8;
protected _sharpness = 0.8;

@tooltip('i18n:fsr.sharpness')
@slide
Expand All @@ -19,7 +19,7 @@ export class FSR extends PostProcessSetting {
get sharpness (): number {
return this._sharpness;
}
set sharpness (v) {
set sharpness (v: number) {
this._sharpness = v;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PostProcess } from './post-process';
@requireComponent(PostProcess)
@executeInEditMode
export class PostProcessSetting extends Component {
static _default: PostProcessSetting | undefined
protected static _default: PostProcessSetting | undefined;
static get default (): PostProcessSetting {
if (!this._default) {
this._default = new this();
Expand Down
2 changes: 1 addition & 1 deletion cocos/rendering/post-process/components/post-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class PostProcess extends Component {
global = true;

@property
_shadingScale = 1;
protected _shadingScale = 1;
@tooltip('i18n:postprocess.shadingScale')
@slide
@range([0.01, 4, 0.01])
Expand Down
8 changes: 4 additions & 4 deletions cocos/rendering/post-process/components/taa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { PostProcessSetting } from './post-process-setting';
@executeInEditMode
export class TAA extends PostProcessSetting {
@property
_sampleScale = 1;
protected _sampleScale = 1;

@tooltip('i18n:taa.sampleScale')
@slide
Expand All @@ -18,20 +18,20 @@ export class TAA extends PostProcessSetting {
get sampleScale (): number {
return this._sampleScale;
}
set sampleScale (v) {
set sampleScale (v: number) {
this._sampleScale = v;
}

@property
_feedback = 0.95;
protected _feedback = 0.95;
@tooltip('i18n:taa.feedback')
@slide
@range([0.0, 1, 0.01])
@property
get feedback (): number {
return this._feedback;
}
set feedback (v) {
set feedback (v: number) {
this._feedback = v;
}
}

0 comments on commit d007151

Please sign in to comment.