完善灰化效果

This commit is contained in:
caizhitao
2020-01-03 14:20:31 +08:00
parent 8d7b8013c4
commit ed1da3ae1c
4 changed files with 22 additions and 34 deletions

View File

@@ -31,7 +31,7 @@ export default class GrayEffectScene extends cc.Component {
// 更新材质
this._updateRenderComponentMaterial({
oldLevel: this._grayLevelSlider.progress
grayLevel: this._grayLevelSlider.progress
});
}
@@ -46,12 +46,12 @@ export default class GrayEffectScene extends cc.Component {
/**
* 灰化程度 [0.0, 1.0] 1.0 表示完全灰化
*/
oldLevel: number;
grayLevel: number;
}) {
this._examplesParentNode.children.forEach(childNode => {
childNode.getComponents(cc.RenderComponent).forEach(renderComponent => {
let material: cc.Material = renderComponent.getMaterial(0);
material.setProperty("oldLevel", param.oldLevel);
material.setProperty("grayLevel", param.grayLevel);
renderComponent.setMaterial(0, material);
});
});