From ae865a7c5f13a4d3b9d072513215fc09bc3f5504 Mon Sep 17 00:00:00 2001 From: caizhitao Date: Sun, 12 Jan 2020 09:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=95=88=E6=9E=9C=E5=90=8D?= =?UTF-8?q?=E4=B8=BA=E7=82=B9=E5=85=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...l-diffusion.effect => sprite-point-light.effect} | 2 +- ...n.effect.meta => sprite-point-light.effect.meta} | 0 ...e-local-diffusion.mtl => sprite-point-light.mtl} | 0 ...ffusion.mtl.meta => sprite-point-light.mtl.meta} | 0 ...nEffectScene.fire => PointLightEffectScene.fire} | 0 ...ne.fire.meta => PointLightEffectScene.fire.meta} | 0 ...lDiffusionCtrl.ts => PointLightCtrlComponent.ts} | 8 ++++---- ...Ctrl.ts.meta => PointLightCtrlComponent.ts.meta} | 0 ...usionEffectScene.ts => PointLightEffectScene.ts} | 8 ++++---- ...tScene.ts.meta => PointLightEffectScene.ts.meta} | 0 ...ocal-diffusion.gif => 2d-sprite-point-light.gif} | Bin 11 files changed, 9 insertions(+), 9 deletions(-) rename assets/effects/{sprite-local-diffusion.effect => sprite-point-light.effect} (99%) rename assets/effects/{sprite-local-diffusion.effect.meta => sprite-point-light.effect.meta} (100%) rename assets/materials/{sprite-local-diffusion.mtl => sprite-point-light.mtl} (100%) rename assets/materials/{sprite-local-diffusion.mtl.meta => sprite-point-light.mtl.meta} (100%) rename assets/scenes/{LocalDiffusionEffectScene.fire => PointLightEffectScene.fire} (100%) rename assets/scenes/{LocalDiffusionEffectScene.fire.meta => PointLightEffectScene.fire.meta} (100%) rename assets/scripts/{LocalDiffusionCtrl.ts => PointLightCtrlComponent.ts} (91%) rename assets/scripts/{LocalDiffusionCtrl.ts.meta => PointLightCtrlComponent.ts.meta} (100%) rename assets/scripts/{LocalDiffusionEffectScene.ts => PointLightEffectScene.ts} (94%) rename assets/scripts/{LocalDiffusionEffectScene.ts.meta => PointLightEffectScene.ts.meta} (100%) rename static/effects/{2d-sprite-local-diffusion.gif => 2d-sprite-point-light.gif} (100%) diff --git a/assets/effects/sprite-local-diffusion.effect b/assets/effects/sprite-point-light.effect similarity index 99% rename from assets/effects/sprite-local-diffusion.effect rename to assets/effects/sprite-point-light.effect index 93550c5..f66fed9 100644 --- a/assets/effects/sprite-local-diffusion.effect +++ b/assets/effects/sprite-point-light.effect @@ -3,7 +3,7 @@ // 原理: // 1. 画圆 // 2. 圆心高亮(透明度=1.0),圆边缘不亮(透明度=0.0) -// 4. 在原图像上方叠加圆 +// 3. 在原图像上方叠加圆 CCEffect %{ techniques: diff --git a/assets/effects/sprite-local-diffusion.effect.meta b/assets/effects/sprite-point-light.effect.meta similarity index 100% rename from assets/effects/sprite-local-diffusion.effect.meta rename to assets/effects/sprite-point-light.effect.meta diff --git a/assets/materials/sprite-local-diffusion.mtl b/assets/materials/sprite-point-light.mtl similarity index 100% rename from assets/materials/sprite-local-diffusion.mtl rename to assets/materials/sprite-point-light.mtl diff --git a/assets/materials/sprite-local-diffusion.mtl.meta b/assets/materials/sprite-point-light.mtl.meta similarity index 100% rename from assets/materials/sprite-local-diffusion.mtl.meta rename to assets/materials/sprite-point-light.mtl.meta diff --git a/assets/scenes/LocalDiffusionEffectScene.fire b/assets/scenes/PointLightEffectScene.fire similarity index 100% rename from assets/scenes/LocalDiffusionEffectScene.fire rename to assets/scenes/PointLightEffectScene.fire diff --git a/assets/scenes/LocalDiffusionEffectScene.fire.meta b/assets/scenes/PointLightEffectScene.fire.meta similarity index 100% rename from assets/scenes/LocalDiffusionEffectScene.fire.meta rename to assets/scenes/PointLightEffectScene.fire.meta diff --git a/assets/scripts/LocalDiffusionCtrl.ts b/assets/scripts/PointLightCtrlComponent.ts similarity index 91% rename from assets/scripts/LocalDiffusionCtrl.ts rename to assets/scripts/PointLightCtrlComponent.ts index 5705190..0d91405 100644 --- a/assets/scripts/LocalDiffusionCtrl.ts +++ b/assets/scripts/PointLightCtrlComponent.ts @@ -1,8 +1,8 @@ const { ccclass, property } = cc._decorator; @ccclass -export default class LocalDiffusionCtrl extends cc.Component { - private _localDiffusionUniform: LocalDiffusionUniform = new LocalDiffusionUniform(); +export default class PointLightCtrlComponent extends cc.Component { + private _localDiffusionUniform: PointLightUniform = new PointLightUniform(); onEnable() { this.node.on(cc.Node.EventType.TOUCH_START, this._onTouchStart, this); @@ -34,7 +34,7 @@ export default class LocalDiffusionCtrl extends cc.Component { this._updateMaterial(); } - private _onPropertyChange(localDiffusionUniform: LocalDiffusionUniform) { + private _onPropertyChange(localDiffusionUniform: PointLightUniform) { this._localDiffusionUniform.centerColor = localDiffusionUniform.centerColor; this._localDiffusionUniform.radius = localDiffusionUniform.radius; this._localDiffusionUniform.cropAlpha = localDiffusionUniform.cropAlpha; @@ -55,7 +55,7 @@ export default class LocalDiffusionCtrl extends cc.Component { } } -export class LocalDiffusionUniform { +export class PointLightUniform { /** * 中心点颜色 */ diff --git a/assets/scripts/LocalDiffusionCtrl.ts.meta b/assets/scripts/PointLightCtrlComponent.ts.meta similarity index 100% rename from assets/scripts/LocalDiffusionCtrl.ts.meta rename to assets/scripts/PointLightCtrlComponent.ts.meta diff --git a/assets/scripts/LocalDiffusionEffectScene.ts b/assets/scripts/PointLightEffectScene.ts similarity index 94% rename from assets/scripts/LocalDiffusionEffectScene.ts rename to assets/scripts/PointLightEffectScene.ts index 492b374..8ccb497 100644 --- a/assets/scripts/LocalDiffusionEffectScene.ts +++ b/assets/scripts/PointLightEffectScene.ts @@ -1,9 +1,9 @@ -import LocalDiffusionCtrl, { LocalDiffusionUniform } from "./LocalDiffusionCtrl"; +import PointLightCtrlComponent, { PointLightUniform } from "./PointLightCtrlComponent"; const { ccclass, property } = cc._decorator; @ccclass -export default class LocalDiffusionEffectScene extends cc.Component { +export default class PointLightEffectScene extends cc.Component { private _redSlider: cc.Slider = null; private _redSliderLabel: cc.Label = null; private _greenSlider: cc.Slider = null; @@ -40,7 +40,7 @@ export default class LocalDiffusionEffectScene extends cc.Component { // 代码添加控制脚本 this._examplesParentNode = cc.find("Canvas/Content/Examples"); this._examplesParentNode.children.forEach(childNode => { - childNode.addComponent(LocalDiffusionCtrl); + childNode.addComponent(PointLightCtrlComponent); }); } @@ -78,7 +78,7 @@ export default class LocalDiffusionEffectScene extends cc.Component { // 通知子节点更新材质 this._examplesParentNode.children.forEach(childNode => { - childNode.emit("on_property_change", { + childNode.emit("on_property_change", { centerColor: cc.color( Math.round(255 * this._redSlider.progress), Math.round(255 * this._greenSlider.progress), diff --git a/assets/scripts/LocalDiffusionEffectScene.ts.meta b/assets/scripts/PointLightEffectScene.ts.meta similarity index 100% rename from assets/scripts/LocalDiffusionEffectScene.ts.meta rename to assets/scripts/PointLightEffectScene.ts.meta diff --git a/static/effects/2d-sprite-local-diffusion.gif b/static/effects/2d-sprite-point-light.gif similarity index 100% rename from static/effects/2d-sprite-local-diffusion.gif rename to static/effects/2d-sprite-point-light.gif