mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
26 lines
783 B
TypeScript
26 lines
783 B
TypeScript
import { ccclass, executeInEditMode, requireComponent } from '../../../core/data/decorators';
|
|
import { Component } from '../../../scene-graph';
|
|
import { PostProcess } from './post-process';
|
|
|
|
@ccclass('cc.PostProcessSetting')
|
|
@requireComponent(PostProcess)
|
|
@executeInEditMode
|
|
export class PostProcessSetting extends Component {
|
|
protected static _default: PostProcessSetting | undefined;
|
|
static get default (): PostProcessSetting {
|
|
if (!this._default) {
|
|
this._default = new this();
|
|
}
|
|
return this._default;
|
|
}
|
|
|
|
onEnable (): void {
|
|
const pp = this.getComponent(PostProcess);
|
|
pp?.addSetting(this);
|
|
}
|
|
onDisable (): void {
|
|
const pp = this.getComponent(PostProcess);
|
|
pp?.removeSetting(this);
|
|
}
|
|
}
|