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