├── README.md ├── assets ├── Scripts.meta ├── Scripts │ ├── CustomMaterial.js │ ├── CustomMaterial.js.meta │ ├── ShaderLib.js │ ├── ShaderLib.js.meta │ ├── Shaders.meta │ ├── Shaders │ │ ├── GaussBlurs.js │ │ ├── GaussBlurs.js.meta │ │ ├── Glowing.js │ │ ├── Glowing.js.meta │ │ ├── Mosaic.js │ │ ├── Mosaic.js.meta │ │ ├── Outline.js │ │ ├── Outline.js.meta │ │ ├── OverlayShader.js │ │ ├── OverlayShader.js.meta │ │ ├── RadialBlur.js │ │ ├── RadialBlur.js.meta │ │ ├── RainShader.js │ │ ├── RainShader.js.meta │ │ ├── Water.js │ │ ├── Water.js.meta │ │ ├── WaveShader.js │ │ └── WaveShader.js.meta │ ├── SpriteHook.js │ ├── SpriteHook.js.meta │ ├── main.js │ └── main.js.meta ├── Textures.meta ├── Textures │ ├── image.jpg │ ├── image.jpg.meta │ ├── image2.png │ └── image2.png.meta ├── main.fire └── main.fire.meta ├── creator.d.ts ├── jsconfig.json ├── project.json ├── settings └── project.json └── snapshot ├── gray.jpg ├── normal.jpg ├── overlay.jpg ├── rain.jpg └── wave.jpg /README.md: -------------------------------------------------------------------------------- 1 | # creator_2_0_material_demo 2 | 3 | ## 简介 4 | 5 | 使用Creator2.0的材质系统实现几个Shader,效果如下: 6 | 7 | - 正常效果(Sprite自带): 8 | ![效果](https://github.com/colinsusie/creator_2_0_material_demo/blob/master/snapshot/normal.jpg) 9 | 10 | - 灰度效果(Sprite自带): 11 | ![效果](https://github.com/colinsusie/creator_2_0_material_demo/blob/master/snapshot/gray.jpg) 12 | 13 | - 高亮叠加效果 14 | ![效果](https://github.com/colinsusie/creator_2_0_material_demo/blob/master/snapshot/overlay.jpg) 15 | 16 | - 雨水效果 17 | ![效果](https://github.com/colinsusie/creator_2_0_material_demo/blob/master/snapshot/rain.jpg) 18 | 19 | ## 实现概述 20 | 21 | ### 修改Sprite对材质的默认支持 22 | 23 | Sprite默认提供了两种材质效果,就是上面的**正常效果**,和**灰度效果**,个人觉得实现得有点局限性:比如我想实现一种效果(如上面的高亮),只能通过外部强制指定材质来实现,如果Sprite换了另一张纹理,或是Sprite同时有一个Animation组件用于播放序列帧,那么Sprite内部会强制切换回正常效果。 24 | 25 | 所以,我Hook了Sprite的实现,增加自定义材质的逻辑,代码在: 26 | [SpriteHook](https://github.com/colinsusie/creator_2_0_material_demo/blob/master/assets/Scripts/SpriteHook.js) 27 | 28 | ### 自定义材质类 29 | 30 | 继承自引擎的`Material`类,实现了一个[CustomMaterial](https://github.com/colinsusie/creator_2_0_material_demo/blob/master/assets/Scripts/CustomMaterial.js),这个材质类可以实现各种不同的效果。 31 | 32 | ### Demo代码片段 33 | 34 | 高亮效果 35 | ```js 36 | { 37 | var name = 'overlay'; 38 | var mat = this.spImage.getMaterial(name); 39 | if (!mat) { 40 | var CustomMaterial = require("CustomMaterial"); 41 | mat = new CustomMaterial(name); 42 | this.spImage.setMaterial(name, mat); 43 | } 44 | this.spImage.node.color = new cc.Color().fromHEX("#FBC00C") 45 | this.spImage.activateMaterial(name); 46 | } 47 | ``` 48 | 49 | 雨效果 50 | ```js 51 | // 雨珠效果 52 | this.resetImage(); 53 | 54 | this._start = Date.now(); 55 | var name = 'rainheart'; 56 | var mat = this.spImage.getMaterial(name); 57 | if (!mat) { 58 | var CustomMaterial = require("CustomMaterial"); 59 | mat = new CustomMaterial(name, 60 | [ 61 | { name: 'texSize', type: renderer.PARAM_FLOAT2 }, 62 | { name: 'iResolution', type: renderer.PARAM_FLOAT3 }, 63 | { name: 'iTime', type: renderer.PARAM_FLOAT }, 64 | ], 65 | [ 66 | { name: 'HAS_HEART', value: false }, 67 | { name: 'USE_POST_PROCESSING', value: true } 68 | ]); 69 | this.spImage.setMaterial(name, mat); 70 | } 71 | this.spImage.activateMaterial(name); 72 | mat.texture.update({flipY: true}); 73 | var iResolution = new cc.Vec3(this.spImage.node.width, this.spImage.node.height, 0); 74 | var texSize = new cc.Vec2(this.spImage.node.width, this.spImage.node.height); 75 | mat.setParamValue("iResolution", iResolution); 76 | mat.setParamValue("texSize", texSize); 77 | ``` 78 | 79 | ### 增加更多的Shader效果 80 | 81 | [Shaders](https://github.com/colinsusie/creator_2_0_material_demo/tree/master/assets/Scripts/Shaders)目录中只有两个,有兴趣的欢迎增加更多的效果:) 82 | -------------------------------------------------------------------------------- /assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "9946dea0-ef2c-41c3-bd4e-5134b8d1385b", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scripts/CustomMaterial.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 自定义材质 3 | */ 4 | 5 | const renderEngine = cc.renderer.renderEngine; 6 | const renderer = renderEngine.renderer; 7 | const gfx = renderEngine.gfx; 8 | const Material = renderEngine.Material; 9 | 10 | var CustomMaterial = (function (Material$$1) { 11 | function CustomMaterial(shaderName, params, defines) { 12 | Material$$1.call(this, false); 13 | 14 | var pass = new renderer.Pass(shaderName); 15 | pass.setDepth(false, false); 16 | pass.setCullMode(gfx.CULL_NONE); 17 | pass.setBlend( 18 | gfx.BLEND_FUNC_ADD, 19 | gfx.BLEND_SRC_ALPHA, gfx.BLEND_ONE_MINUS_SRC_ALPHA, 20 | gfx.BLEND_FUNC_ADD, 21 | gfx.BLEND_SRC_ALPHA, gfx.BLEND_ONE_MINUS_SRC_ALPHA 22 | ); 23 | 24 | var techParams = [ 25 | { name: 'texture', type: renderer.PARAM_TEXTURE_2D }, 26 | { name: 'color', type: renderer.PARAM_COLOR4 } 27 | ]; 28 | if (params) { 29 | techParams = techParams.concat(params); 30 | } 31 | var mainTech = new renderer.Technique( 32 | ['transparent'], 33 | techParams, 34 | [pass] 35 | ); 36 | 37 | this.name = shaderName; 38 | this._color = { r: 1, g: 1, b: 1, a: 1 }; 39 | this._effect = new renderer.Effect( 40 | [ 41 | mainTech 42 | ], 43 | {}, 44 | defines, 45 | ); 46 | 47 | this._mainTech = mainTech; 48 | this._texture = null; 49 | } 50 | 51 | if (Material$$1) CustomMaterial.__proto__ = Material$$1; 52 | CustomMaterial.prototype = Object.create(Material$$1 && Material$$1.prototype); 53 | CustomMaterial.prototype.constructor = CustomMaterial; 54 | 55 | var prototypeAccessors = { effect: { configurable: true }, texture: { configurable: true }, color: { configurable: true } }; 56 | 57 | prototypeAccessors.effect.get = function () { 58 | return this._effect; 59 | }; 60 | 61 | prototypeAccessors.texture.get = function () { 62 | return this._texture; 63 | }; 64 | 65 | prototypeAccessors.texture.set = function (val) { 66 | if (this._texture !== val) { 67 | this._texture = val; 68 | this._effect.setProperty('texture', val.getImpl()); 69 | this._texIds['texture'] = val.getId(); 70 | } 71 | }; 72 | 73 | prototypeAccessors.color.get = function () { 74 | return this._color; 75 | }; 76 | 77 | prototypeAccessors.color.set = function (val) { 78 | var color = this._color; 79 | color.r = val.r / 255; 80 | color.g = val.g / 255; 81 | color.b = val.b / 255; 82 | color.a = val.a / 255; 83 | this._effect.setProperty('color', color); 84 | }; 85 | 86 | CustomMaterial.prototype.clone = function clone() { 87 | var copy = new CustomMaterial(); 88 | copy.texture = this.texture; 89 | copy.color = this.color; 90 | copy.updateHash(); 91 | return copy; 92 | }; 93 | 94 | // 设置自定义参数的值 95 | CustomMaterial.prototype.setParamValue = function (name, value) { 96 | this._effect.setProperty(name, value); 97 | }; 98 | 99 | // 设置定义值 100 | CustomMaterial.prototype.setDefine = function (name, value) { 101 | this._effect.define(name, value); 102 | }; 103 | 104 | Object.defineProperties(CustomMaterial.prototype, prototypeAccessors); 105 | 106 | return CustomMaterial; 107 | }(Material)); 108 | 109 | module.exports = CustomMaterial; -------------------------------------------------------------------------------- /assets/Scripts/CustomMaterial.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "91e77b9b-b111-410d-a43a-b93edc703c79", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/ShaderLib.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Shader库 3 | */ 4 | 5 | var ShaderLib = { 6 | _shaders: {}, 7 | 8 | // 增加一个新的Shader 9 | addShader: function(shader) { 10 | if (this._shaders[shader.name]) { 11 | console.error("addShader - shader already exist: ", shader.name); 12 | return; 13 | } 14 | cc.renderer._forward._programLib.define(shader.name, shader.vert, shader.frag, shader.defines); 15 | this._shaders[shader.name] = shader; 16 | }, 17 | 18 | // 取Shader的定义 19 | getShader: function(name) { 20 | return this._shaders[name]; 21 | } 22 | } 23 | 24 | module.exports = ShaderLib; 25 | 26 | -------------------------------------------------------------------------------- /assets/Scripts/ShaderLib.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "3b680987-ad06-4cb6-a617-efbc865d7107", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "356b88f3-dd9a-4fc5-a76f-cb240cbd1c97", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/GaussBlurs.js: -------------------------------------------------------------------------------- 1 | // Shader: 高斯模糊 2 | 3 | var shader = { 4 | name: "GaussBlurs", 5 | 6 | defines: [], 7 | 8 | vert: `uniform mat4 viewProj; 9 | attribute vec3 a_position; 10 | attribute vec2 a_uv0; 11 | varying vec2 uv0; 12 | void main () { 13 | vec4 pos = viewProj * vec4(a_position, 1); 14 | gl_Position = pos; 15 | uv0 = a_uv0; 16 | } 17 | `, 18 | 19 | frag: `uniform sampler2D texture; 20 | varying vec2 uv0; 21 | uniform float bluramount; 22 | 23 | vec4 draw(vec2 uv) { 24 | return texture2D(texture, uv).rgba; 25 | } 26 | 27 | float grid(float var, float size) { 28 | return floor(var*size)/size; 29 | } 30 | 31 | float rand(vec2 co){ 32 | return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); 33 | } 34 | 35 | void mainImage( out vec4 fragColor, in vec2 uv0 ) 36 | { 37 | vec2 uv = uv0.xy; 38 | vec4 blurred_image = vec4(0.); 39 | #define repeats 5. 40 | for (float i = 0.; i < repeats; i++) { 41 | vec2 q = vec2(cos(degrees((i/repeats)*360.)),sin(degrees((i/repeats)*360.))) * (rand(vec2(i,uv.x+uv.y))+bluramount); 42 | vec2 uv2 = uv+(q*bluramount); 43 | blurred_image += draw(uv2)/2.; 44 | q = vec2(cos(degrees((i/repeats)*360.)),sin(degrees((i/repeats)*360.))) * (rand(vec2(i+2.,uv.x+uv.y+24.))+bluramount); 45 | uv2 = uv+(q*bluramount); 46 | blurred_image += draw(uv2)/2.; 47 | } 48 | blurred_image /= repeats; 49 | fragColor = vec4(blurred_image); 50 | } 51 | 52 | void main() 53 | { 54 | mainImage(gl_FragColor, uv0.xy); 55 | }`, 56 | } 57 | 58 | module.exports = shader; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/GaussBlurs.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d7e5c6ee-cf7f-4746-8b85-ed31e08623d1", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/Glowing.js: -------------------------------------------------------------------------------- 1 | // Shader: 外发光 2 | 3 | var shader = { 4 | name: "Glowing", 5 | 6 | defines: [], 7 | 8 | vert: `uniform mat4 viewProj; 9 | attribute vec3 a_position; 10 | attribute vec2 a_uv0; 11 | varying vec2 uv0; 12 | void main () { 13 | vec4 pos = viewProj * vec4(a_position, 1); 14 | gl_Position = pos; 15 | uv0 = a_uv0; 16 | } 17 | `, 18 | 19 | frag: `uniform sampler2D texture; 20 | uniform vec3 iResolution; 21 | uniform float iTime; 22 | uniform vec4 color; 23 | varying vec2 uv0; 24 | 25 | const float radius = 4.0; 26 | // const vec3 color = vec3(0.9, 0.9, 0.0); 27 | 28 | float coefficient() 29 | { 30 | float v = mod(iTime, 3.0); 31 | if(v > 1.5) 32 | v = 3.0 - v; 33 | return v; 34 | } 35 | 36 | void mainImage( out vec4 fragColor, in vec2 fragCoord ) 37 | { 38 | vec2 uv = fragCoord.xy; 39 | vec2 unit = 1.0 / iResolution.xy; 40 | vec4 texel = texture2D(texture, uv); 41 | vec4 finalColor = vec4(0.0); 42 | float density = 0.0; 43 | 44 | if(texel.a >= 1.0) 45 | { 46 | finalColor = texel; 47 | } 48 | else 49 | { 50 | for(int i = 0; i < int(radius); ++i) 51 | { 52 | density += texture2D(texture, vec2(uv.x + unit.x * float(i), uv.y + unit.y * float(i))).a; 53 | density += texture2D(texture, vec2(uv.x - unit.x * float(i), uv.y + unit.y * float(i))).a; 54 | density += texture2D(texture, vec2(uv.x - unit.x * float(i), uv.y - unit.y * float(i))).a; 55 | density += texture2D(texture, vec2(uv.x + unit.x * float(i), uv.y - unit.y * float(i))).a; 56 | } 57 | density = density / radius; 58 | finalColor = vec4(color.rgb * density, density); 59 | finalColor += vec4(texel.rgb * texel.a, texel.a); 60 | } 61 | fragColor = finalColor; 62 | } 63 | 64 | void main() 65 | { 66 | mainImage(gl_FragColor, uv0.xy); 67 | }`, 68 | } 69 | 70 | module.exports = shader; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/Glowing.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "d292deb8-9c3c-42b6-b2db-71148bd36773", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/Mosaic.js: -------------------------------------------------------------------------------- 1 | // Shader: 方形马赛克 2 | 3 | var shader = { 4 | name: "Mosaic", 5 | 6 | defines: [], 7 | 8 | vert: `uniform mat4 viewProj; 9 | attribute vec3 a_position; 10 | attribute vec2 a_uv0; 11 | varying vec2 uv0; 12 | void main () { 13 | vec4 pos = viewProj * vec4(a_position, 1); 14 | gl_Position = pos; 15 | uv0 = a_uv0; 16 | } 17 | `, 18 | 19 | frag: `uniform sampler2D texture; 20 | uniform vec3 iResolution; 21 | uniform float mosaicSize; 22 | varying vec2 uv0; 23 | 24 | void main(void) 25 | { 26 | vec4 color; 27 | vec2 xy = vec2(uv0.x * iResolution.x, uv0.y * iResolution.y); 28 | vec2 xyMosaic = vec2(floor(xy.x / mosaicSize) * mosaicSize, floor(xy.y / mosaicSize) * mosaicSize); 29 | vec2 xyFloor = vec2(floor(mod(xy.x, mosaicSize)), floor(mod(xy.y, mosaicSize))); 30 | vec2 uvMosaic = vec2(xyMosaic.x / iResolution.x, xyMosaic.y / iResolution.y); 31 | color = texture2D( texture, uvMosaic); 32 | gl_FragColor = color; 33 | }`, 34 | } 35 | 36 | module.exports = shader; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/Mosaic.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "5688d7c3-39c6-40c4-9e16-5d22caafa848", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/Outline.js: -------------------------------------------------------------------------------- 1 | // Shader: 描边 2 | 3 | var shader = { 4 | name: "Outline", 5 | 6 | defines: [], 7 | 8 | vert: `uniform mat4 viewProj; 9 | attribute vec3 a_position; 10 | attribute vec2 a_uv0; 11 | varying vec2 uv0; 12 | void main () { 13 | vec4 pos = viewProj * vec4(a_position, 1); 14 | gl_Position = pos; 15 | uv0 = a_uv0; 16 | } 17 | `, 18 | 19 | frag: `uniform sampler2D texture; 20 | varying vec2 uv0; 21 | uniform vec3 iResolution; 22 | 23 | void main() 24 | { 25 | vec2 onePixel = vec2(1.0 / iResolution.x, 1.0 / iResolution.y); 26 | 27 | vec4 color = texture2D(texture, uv0.xy); 28 | vec4 colorRight = texture2D(texture, uv0.xy + vec2(0,onePixel.t)); 29 | vec4 colorBottom = texture2D(texture, uv0.xy + vec2(onePixel.s,0)); 30 | 31 | color.r = 3.0* sqrt( (color.r - colorRight.r) * (color.r - colorRight.r) + (color.r - colorBottom.r) * (color.r - colorBottom.r) ); 32 | color.g = 3.0* sqrt( (color.g - colorRight.g) * (color.g - colorRight.g) + (color.g - colorBottom.g) * (color.g - colorBottom.g) ); 33 | color.b = 3.0* sqrt( (color.b - colorRight.b) * (color.b - colorRight.b) + (color.b - colorBottom.b) * (color.b - colorBottom.b) ); 34 | 35 | color.r >1.0 ? 1.0 : color.r; 36 | color.g >1.0 ? 1.0 : color.g; 37 | color.b >1.0 ? 1.0 : color.b; 38 | gl_FragColor = vec4(color.rgb, 1); 39 | }`, 40 | } 41 | 42 | module.exports = shader; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/Outline.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "fc18ad1f-06b3-466a-b151-8e48a2f0d2e6", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/OverlayShader.js: -------------------------------------------------------------------------------- 1 | // Shader: 纹理与颜色叠加 2 | 3 | var overlay = { 4 | name: "overlay", 5 | 6 | defines: [], 7 | 8 | vert: `uniform mat4 viewProj; 9 | attribute vec3 a_position; 10 | attribute vec2 a_uv0; 11 | varying vec2 uv0; 12 | void main () { 13 | vec4 pos = viewProj * vec4(a_position, 1); 14 | gl_Position = pos; 15 | uv0 = a_uv0; 16 | } 17 | `, 18 | 19 | frag: `uniform sampler2D texture; 20 | varying vec2 uv0; 21 | uniform vec4 color; 22 | void main() 23 | { 24 | vec4 texColor = texture2D(texture, uv0); 25 | if (texColor.r <= 0.5) 26 | gl_FragColor.r = 2.0 * texColor.r * color.r; 27 | else 28 | gl_FragColor.r = 1.0 - 2.0 * (1.0 - texColor.r) * (1.0 - color.r); 29 | if (texColor.g <= 0.5) 30 | gl_FragColor.g = 2.0 * texColor.g * color.g; 31 | else 32 | gl_FragColor.g = 1.0 - 2.0 * (1.0 - texColor.g) * (1.0 - color.g); 33 | if (texColor.b <= 0.5) 34 | gl_FragColor.b = 2.0 * texColor.b * color.b; 35 | else 36 | gl_FragColor.b = 1.0 - 2.0 * (1.0 - texColor.b) * (1.0 - color.b); 37 | gl_FragColor.a = texColor.a * color.a; 38 | }`, 39 | } 40 | 41 | module.exports = overlay; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/OverlayShader.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "91e3eca9-e807-4f49-a689-7a5e0ee67684", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/RadialBlur.js: -------------------------------------------------------------------------------- 1 | // Shader: 径向模糊 2 | 3 | var shader = { 4 | name: "RadialBlur", 5 | 6 | defines: [], 7 | 8 | vert: `uniform mat4 viewProj; 9 | attribute vec3 a_position; 10 | attribute vec2 a_uv0; 11 | varying vec2 uv0; 12 | void main () { 13 | vec4 pos = viewProj * vec4(a_position, 1); 14 | gl_Position = pos; 15 | uv0 = a_uv0; 16 | } 17 | `, 18 | 19 | frag: `uniform sampler2D texture; 20 | uniform vec3 iResolution; 21 | uniform vec2 iCenter; 22 | varying vec2 uv0; 23 | 24 | void mainImage( out vec4 fragColor, in vec2 fragCoord ) 25 | { 26 | const float Strength = 0.125; 27 | const int Samples = 64; //multiple of 2 28 | 29 | vec2 uv = fragCoord.xy; 30 | 31 | vec2 dir = (fragCoord.xy-iCenter.xy); 32 | 33 | vec4 color = vec4(0.0,0.0,0.0,0.0); 34 | 35 | for (int i = 0; i < Samples; i += 2) //operating at 2 samples for better performance 36 | { 37 | color += texture2D(texture,uv+float(i)/float(Samples)*dir*Strength); 38 | color += texture2D(texture,uv+float(i+1)/float(Samples)*dir*Strength); 39 | } 40 | 41 | fragColor = color/float(Samples); 42 | } 43 | 44 | void main(void) 45 | { 46 | mainImage(gl_FragColor, uv0); 47 | }`, 48 | } 49 | 50 | module.exports = shader; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/RadialBlur.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "60821526-dead-4936-b9bd-1883a4a6447f", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/RainShader.js: -------------------------------------------------------------------------------- 1 | let shader = { 2 | name: 'rainheart', 3 | 4 | defines: [ 5 | { name: 'HAS_HEART', }, 6 | { name: 'USE_POST_PROCESSING', }, 7 | ], 8 | 9 | vert: 10 | ` 11 | uniform mat4 viewProj; 12 | uniform mat4 model; 13 | attribute vec3 a_position; 14 | attribute vec2 a_uv0; 15 | varying vec2 uv0; 16 | void main () { 17 | mat4 mvp; 18 | mvp = viewProj * model; 19 | 20 | vec4 pos = mvp * vec4(a_position, 1); 21 | gl_Position = pos; 22 | uv0 = a_uv0; 23 | } 24 | `, 25 | frag: 26 | ` 27 | // Heartfelt - by Martijn Steinrucken aka BigWings - 2017 28 | // countfrolic@gmail.com 29 | // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 30 | 31 | // I revisited the rain effect I did for another shader. This one is better in multiple ways: 32 | // 1. The glass gets foggy. 33 | // 2. Drops cut trails in the fog on the glass. 34 | // 3. The amount of rain is adjustable (with Mouse.y) 35 | 36 | // To have full control over the rain, uncomment the HAS_HEART define 37 | 38 | // A video of the effect can be found here: 39 | // https://www.youtube.com/watch?v=uiF5Tlw22PI&feature=youtu.be 40 | 41 | // Music - Alone In The Dark - Vadim Kiselev 42 | // https://soundcloud.com/ahmed-gado-1/sad-piano-alone-in-the-dark 43 | // Rain sounds: 44 | // https://soundcloud.com/elirtmusic/sleeping-sound-rain-and-thunder-1-hours 45 | 46 | #define S(a, b, t) smoothstep(a, b, t) 47 | //#define CHEAP_NORMALS 48 | 49 | uniform sampler2D texture; 50 | uniform vec4 color; 51 | uniform vec3 iResolution; 52 | uniform float iTime; 53 | uniform vec2 texSize; 54 | varying vec2 uv0; 55 | 56 | vec3 N13(float p) { 57 | // from DAVE HOSKINS 58 | vec3 p3 = fract(vec3(p) * vec3(.1031,.11369,.13787)); 59 | p3 += dot(p3, p3.yzx + 19.19); 60 | return fract(vec3((p3.x + p3.y)*p3.z, (p3.x+p3.z)*p3.y, (p3.y+p3.z)*p3.x)); 61 | } 62 | 63 | vec4 N14(float t) { 64 | return fract(sin(t*vec4(123., 1024., 1456., 264.))*vec4(6547., 345., 8799., 1564.)); 65 | } 66 | float N(float t) { 67 | return fract(sin(t*12345.564)*7658.76); 68 | } 69 | 70 | float Saw(float b, float t) { 71 | return S(0., b, t)*S(1., b, t); 72 | } 73 | 74 | vec2 DropLayer2(vec2 uv, float t) { 75 | vec2 UV = uv; 76 | 77 | uv.y += t*0.75; 78 | vec2 a = vec2(6., 1.); 79 | vec2 grid = a*2.; 80 | vec2 id = floor(uv*grid); 81 | 82 | float colShift = N(id.x); 83 | uv.y += colShift; 84 | 85 | id = floor(uv*grid); 86 | vec3 n = N13(id.x*35.2+id.y*2376.1); 87 | vec2 st = fract(uv*grid)-vec2(.5, 0); 88 | 89 | float x = n.x-.5; 90 | 91 | float y = UV.y*20.; 92 | float wiggle = sin(y+sin(y)); 93 | x += wiggle*(.5-abs(x))*(n.z-.5); 94 | x *= .7; 95 | float ti = fract(t+n.z); 96 | y = (Saw(.85, ti)-.5)*.9+.5; 97 | vec2 p = vec2(x, y); 98 | 99 | float d = length((st-p)*a.yx); 100 | 101 | float mainDrop = S(.4, .0, d); 102 | 103 | float r = sqrt(S(1., y, st.y)); 104 | float cd = abs(st.x-x); 105 | float trail = S(.23*r, .15*r*r, cd); 106 | float trailFront = S(-.02, .02, st.y-y); 107 | trail *= trailFront*r*r; 108 | 109 | y = UV.y; 110 | float trail2 = S(.2*r, .0, cd); 111 | float droplets = max(0., (sin(y*(1.-y)*120.)-st.y))*trail2*trailFront*n.z; 112 | y = fract(y*10.)+(st.y-.5); 113 | float dd = length(st-vec2(x, y)); 114 | droplets = S(.3, 0., dd); 115 | float m = mainDrop+droplets*r*trailFront; 116 | 117 | //m += st.x>a.y*.45 || st.y>a.x*.165 ? 1.2 : 0.; 118 | return vec2(m, trail); 119 | } 120 | 121 | float StaticDrops(vec2 uv, float t) { 122 | uv *= 40.; 123 | 124 | vec2 id = floor(uv); 125 | uv = fract(uv)-.5; 126 | vec3 n = N13(id.x*107.45+id.y*3543.654); 127 | vec2 p = (n.xy-.5)*.7; 128 | float d = length(uv-p); 129 | 130 | float fade = Saw(.025, fract(t+n.z)); 131 | float c = S(.3, 0., d)*fract(n.z*10.)*fade; 132 | return c; 133 | } 134 | 135 | vec2 Drops(vec2 uv, float t, float l0, float l1, float l2) { 136 | float s = StaticDrops(uv, t)*l0; 137 | vec2 m1 = DropLayer2(uv, t)*l1; 138 | vec2 m2 = DropLayer2(uv*1.85, t)*l2; 139 | 140 | float c = s+m1.x+m2.x; 141 | c = S(.3, 1., c); 142 | 143 | return vec2(c, max(m1.y*l0, m2.y*l1)); 144 | } 145 | 146 | void main() 147 | { 148 | vec4 iMouse = vec4(0.0, 0.0, 0.0, 0.0); 149 | vec2 fragCoord = vec2(uv0.x * texSize.x - 0.5 * texSize.x, 0.5 * texSize.y - uv0.y * texSize.y); 150 | 151 | vec2 uv = fragCoord.xy / iResolution.y; 152 | vec2 UV = (fragCoord.xy+.5*iResolution.xy) / iResolution.xy; 153 | vec3 M = iMouse.xyz/iResolution.xyz; 154 | float T = iTime+M.x*2.; 155 | 156 | #ifdef HAS_HEART 157 | T = mod(iTime, 102.); 158 | T = mix(T, M.x*102., M.z>0.?1.:0.); 159 | #endif 160 | 161 | float t = T*.2; 162 | 163 | float rainAmount = iMouse.z>0. ? M.y : sin(T*.05)*.3+.7; 164 | 165 | float maxBlur = mix(3., 6., rainAmount); 166 | float minBlur = 2.; 167 | 168 | float story = 0.; 169 | float heart = 0.; 170 | 171 | #ifdef HAS_HEART 172 | story = S(0., 70., T); 173 | 174 | t = min(1., T/70.); // remap drop time so it goes slower when it freezes 175 | t = 1.-t; 176 | t = (1.-t*t)*70.; 177 | 178 | float zoom= mix(.3, 1.2, story); // slowly zoom out 179 | uv *=zoom; 180 | minBlur = 4.+S(.5, 1., story)*3.; // more opaque glass towards the end 181 | maxBlur = 6.+S(.5, 1., story)*1.5; 182 | 183 | vec2 hv = uv-vec2(.0, -.1); // build heart 184 | hv.x *= .5; 185 | float s = S(110., 70., T); // heart gets smaller and fades towards the end 186 | hv.y-=sqrt(abs(hv.x))*.5*s; 187 | heart = length(hv); 188 | heart = S(.4*s, .2*s, heart)*s; 189 | rainAmount = heart; // the rain is where the heart is 190 | 191 | maxBlur-=heart; // inside the heart slighly less foggy 192 | uv *= 1.5; // zoom out a bit more 193 | t *= .25; 194 | #else 195 | float zoom = -cos(T*.2); 196 | uv *= .7+zoom*.3; 197 | #endif 198 | UV = (UV-.5)*(.9+zoom*.1)+.5; 199 | 200 | float staticDrops = S(-.5, 1., rainAmount)*2.; 201 | float layer1 = S(.25, .75, rainAmount); 202 | float layer2 = S(.0, .5, rainAmount); 203 | 204 | vec2 c = Drops(uv, t, staticDrops, layer1, layer2); 205 | #ifdef CHEAP_NORMALS 206 | vec2 n = vec2(dFdx(c.x), dFdy(c.x));// cheap normals (3x cheaper, but 2 times shittier ;)) 207 | #else 208 | vec2 e = vec2(.001, 0.); 209 | float cx = Drops(uv+e, t, staticDrops, layer1, layer2).x; 210 | float cy = Drops(uv+e.yx, t, staticDrops, layer1, layer2).x; 211 | vec2 n = vec2(cx-c.x, cy-c.x); // expensive normals 212 | #endif 213 | 214 | #ifdef HAS_HEART 215 | n *= 1.-S(60., 85., T); 216 | c.y *= 1.-S(80., 100., T)*.8; 217 | #endif 218 | 219 | float focus = mix(maxBlur-c.y, minBlur, S(.1, .2, c.x)); 220 | vec3 col = texture2D(texture, UV+n).rgb; 221 | // make time sync with first lightnoing 222 | 223 | #ifdef USE_POST_PROCESSING 224 | t = (T+3.)*.5; 225 | float colFade = sin(t*.2)*.5+.5+story; 226 | col *= mix(vec3(1.), vec3(.8, .9, 1.3), colFade); // subtle color shift 227 | float fade = S(0., 10., T); // fade in at the start 228 | float lightning = sin(t*sin(t*10.)); // lighting flicker 229 | lightning *= pow(max(0., sin(t+sin(t))), 10.); // lightning flash 230 | col *= 1.+lightning*fade*mix(1., .1, story*story); // composite lightning 231 | col *= 1.-dot(UV-=.5, UV); // vignette 232 | 233 | #ifdef HAS_HEART 234 | col = mix(pow(col, vec3(1.2)), col, heart); 235 | fade *= S(102., 97., T); 236 | #endif 237 | 238 | col *= fade; // composite start and end fade 239 | #endif 240 | 241 | //col = vec3(heart); 242 | gl_FragColor = vec4(col, 1.); 243 | } 244 | `, 245 | 246 | }; 247 | 248 | module.exports = shader; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/RainShader.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "16f85ff7-5db7-4b77-88c0-f8609478b2da", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/Water.js: -------------------------------------------------------------------------------- 1 | // Shader: 水 2 | 3 | var shader = { 4 | name: "Water", 5 | 6 | defines: [], 7 | 8 | vert: `uniform mat4 viewProj; 9 | attribute vec3 a_position; 10 | attribute vec2 a_uv0; 11 | varying vec2 uv0; 12 | void main () { 13 | vec4 pos = viewProj * vec4(a_position, 1); 14 | gl_Position = pos; 15 | uv0 = a_uv0; 16 | } 17 | `, 18 | 19 | frag: `uniform sampler2D texture; 20 | uniform vec3 iResolution; 21 | uniform float iTime; 22 | varying vec2 uv0; 23 | 24 | #define F cos(x-y)*cos(y),sin(x+y)*sin(y) 25 | 26 | vec2 s(vec2 p) 27 | { 28 | float d=iTime*0.2,x=8.*(p.x+d),y=8.*(p.y+d); 29 | return vec2(F); 30 | } 31 | void mainImage( out vec4 fragColor, in vec2 fragCoord ) 32 | { 33 | // 换成resolution 34 | vec2 rs = iResolution.xy; 35 | // 换成纹理坐标v_texCoord.xy 36 | vec2 uv = fragCoord; 37 | vec2 q = uv+2./iResolution.x*(s(uv)-s(uv+rs)); 38 | //反转y 39 | //q.y=1.-q.y; 40 | fragColor = texture2D(texture, q); 41 | } 42 | void main() 43 | { 44 | mainImage(gl_FragColor, uv0.xy); 45 | }`, 46 | } 47 | 48 | module.exports = shader; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/Water.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "fcf05b9f-460d-41c9-aff5-d47e122c3218", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/Shaders/WaveShader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 波浪流动效果 3 | * */ 4 | const shader = { 5 | name: "wave", 6 | defines: [], 7 | vert: `uniform mat4 viewProj; 8 | attribute vec4 a_position; 9 | attribute vec2 a_uv0; 10 | varying vec2 uv0; 11 | 12 | void main() 13 | { 14 | gl_Position = viewProj * a_position; 15 | uv0 = a_uv0; 16 | } 17 | `, 18 | 19 | frag: ` 20 | uniform sampler2D texture; 21 | uniform vec3 iResolution; 22 | uniform float iTime; 23 | uniform vec2 iOffset; 24 | varying vec2 uv0; 25 | 26 | void main() { 27 | vec2 coord = uv0; 28 | coord.x += (sin(coord.y * 30.0 + iTime * 3.0) / 30.0 * iOffset[0]); 29 | coord.y += (sin(coord.x * 30.0 + iTime * 3.0) / 30.0 * iOffset[1]); 30 | gl_FragColor = texture2D(texture, coord); 31 | }` 32 | }; 33 | 34 | module.exports = shader; -------------------------------------------------------------------------------- /assets/Scripts/Shaders/WaveShader.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "77e51048-b16b-4a7e-9970-127c987d3033", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/SpriteHook.js: -------------------------------------------------------------------------------- 1 | var SpriteHook = { 2 | } 3 | 4 | SpriteHook.init = function() { 5 | // 支持自定义Shader 6 | const renderEngine = cc.renderer.renderEngine; 7 | const SpriteMaterial = renderEngine.SpriteMaterial; 8 | const GraySpriteMaterial = renderEngine.GraySpriteMaterial; 9 | const STATE_CUSTOM = 101; 10 | 11 | // 取自定义材质 12 | cc.Sprite.prototype.getMaterial = function(name) { 13 | if (this._materials) { 14 | return this._materials[name]; 15 | } else { 16 | return undefined; 17 | } 18 | } 19 | 20 | // 设置自定义材质 21 | cc.Sprite.prototype.setMaterial = function(name, mat) { 22 | if (!this._materials) { 23 | this._materials = {} 24 | } 25 | this._materials[name] = mat; 26 | } 27 | 28 | // 激活某个材质 29 | cc.Sprite.prototype.activateMaterial = function(name) { 30 | var mat = this.getMaterial(name); 31 | if (mat && mat !== this._currMaterial) { 32 | if (mat) { 33 | if (this.node) { 34 | mat.color = this.node.color; 35 | } 36 | if (this.spriteFrame) { 37 | mat.texture = this.spriteFrame.getTexture(); 38 | } 39 | this.node._renderFlag |= cc.RenderFlow.FLAG_COLOR; 40 | this._currMaterial = mat; 41 | this._currMaterial.name = name; 42 | this._state = STATE_CUSTOM; 43 | this._activateMaterial(); 44 | } else { 45 | console.error("activateMaterial - unknwon material: ", name); 46 | } 47 | } 48 | } 49 | 50 | // 取当前的材质 51 | cc.Sprite.prototype.getCurrMaterial = function() { 52 | if (this._state === STATE_CUSTOM) { 53 | return this._currMaterial; 54 | } 55 | } 56 | 57 | cc.Sprite.prototype._activateMaterial = function() { 58 | let spriteFrame = this._spriteFrame; 59 | 60 | // WebGL 61 | if (cc.game.renderType !== cc.game.RENDER_TYPE_CANVAS) { 62 | // Get material 63 | let material; 64 | if (this._state === cc.Sprite.State.GRAY) { 65 | if (!this._graySpriteMaterial) { 66 | this._graySpriteMaterial = new GraySpriteMaterial(); 67 | this.node._renderFlag |= cc.RenderFlow.FLAG_COLOR; 68 | } 69 | material = this._graySpriteMaterial; 70 | this._currMaterial = null; 71 | } 72 | else if (this._state === STATE_CUSTOM) { 73 | if (!this._currMaterial) { 74 | console.error("_activateMaterial: _currMaterial undefined!") 75 | return; 76 | } 77 | material = this._currMaterial; 78 | } 79 | else { 80 | if (!this._spriteMaterial) { 81 | this._spriteMaterial = new SpriteMaterial(); 82 | this.node._renderFlag |= cc.RenderFlow.FLAG_COLOR; 83 | } 84 | material = this._spriteMaterial; 85 | this._currMaterial = null; 86 | } 87 | // Set texture 88 | if (spriteFrame && spriteFrame.textureLoaded()) { 89 | let texture = spriteFrame.getTexture(); 90 | if (material.texture !== texture) { 91 | material.texture = texture; 92 | this._updateMaterial(material); 93 | } 94 | else if (material !== this._material) { 95 | this._updateMaterial(material); 96 | } 97 | if (this._renderData) { 98 | this._renderData.material = material; 99 | } 100 | this.markForUpdateRenderData(true); 101 | this.markForRender(true); 102 | } 103 | else { 104 | this.disableRender(); 105 | } 106 | } 107 | } 108 | } 109 | 110 | module.exports = SpriteHook; -------------------------------------------------------------------------------- /assets/Scripts/SpriteHook.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "335fc7f0-0fc9-4dd1-8739-53d48d6d7978", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Scripts/main.js: -------------------------------------------------------------------------------- 1 | const renderEngine = cc.renderer.renderEngine; 2 | const renderer = renderEngine.renderer; 3 | 4 | cc.Class({ 5 | extends: cc.Component, 6 | 7 | properties: { 8 | frame1: cc.SpriteFrame, 9 | frame2: cc.SpriteFrame, 10 | spImage: cc.Sprite, 11 | }, 12 | 13 | start () { 14 | require("SpriteHook").init(); 15 | this.initShaders(); 16 | }, 17 | 18 | initShaders() { 19 | var ShaderLib = require("ShaderLib"); 20 | ShaderLib.addShader(require("OverlayShader")); 21 | ShaderLib.addShader(require("RainShader")); 22 | ShaderLib.addShader(require("WaveShader")); 23 | ShaderLib.addShader(require("GaussBlurs")); 24 | ShaderLib.addShader(require("Outline")); 25 | ShaderLib.addShader(require("Glowing")); 26 | ShaderLib.addShader(require("Water")); 27 | ShaderLib.addShader(require("Mosaic")); 28 | ShaderLib.addShader(require("RadialBlur")); 29 | // TODO: 加更多Shader 30 | }, 31 | 32 | resetImage(frame) { 33 | this.spImage.node.color = new cc.Color().fromHEX("#FFFFFF") 34 | this.spImage.spriteFrame.getTexture().update({flipY: false}); 35 | this.spImage.spriteFrame = frame; 36 | }, 37 | 38 | onClickGray () { 39 | // 灰度图 40 | this.resetImage(this.frame1); 41 | this.spImage.setState(cc.Sprite.State.GRAY); 42 | }, 43 | 44 | onClickNormal () { 45 | // 正常 46 | this.resetImage(this.frame1); 47 | this.spImage.setState(cc.Sprite.State.NORMAL); 48 | }, 49 | 50 | onClickOverlay () { 51 | // 颜色高亮效果 52 | this.resetImage(this.frame2); 53 | var name = 'overlay'; 54 | var mat = this.spImage.getMaterial(name); 55 | if (!mat) { 56 | var CustomMaterial = require("CustomMaterial"); 57 | mat = new CustomMaterial(name); 58 | this.spImage.setMaterial(name, mat); 59 | } 60 | this.spImage.node.color = new cc.Color().fromHEX("#FBC00C") 61 | this.spImage.activateMaterial(name); 62 | }, 63 | 64 | onClickRain () { 65 | // 雨珠效果 66 | this.resetImage(this.frame1); 67 | 68 | this._start = Date.now(); 69 | var name = 'rainheart'; 70 | var mat = this.spImage.getMaterial(name); 71 | if (!mat) { 72 | var CustomMaterial = require("CustomMaterial"); 73 | mat = new CustomMaterial(name, 74 | [ 75 | { name: 'texSize', type: renderer.PARAM_FLOAT2 }, 76 | { name: 'iResolution', type: renderer.PARAM_FLOAT3 }, 77 | { name: 'iTime', type: renderer.PARAM_FLOAT }, 78 | ], 79 | [ 80 | { name: 'HAS_HEART', value: false }, 81 | { name: 'USE_POST_PROCESSING', value: true } 82 | ]); 83 | this.spImage.setMaterial(name, mat); 84 | } 85 | this.spImage.activateMaterial(name); 86 | mat.texture.update({flipY: true}); 87 | var iResolution = new cc.Vec3(this.spImage.node.width, this.spImage.node.height, 0); 88 | var texSize = new cc.Vec2(this.spImage.node.width, this.spImage.node.height); 89 | mat.setParamValue("iResolution", iResolution); 90 | mat.setParamValue("texSize", texSize); 91 | }, 92 | 93 | onClickWave () { 94 | this.resetImage(this.frame1); 95 | const name = 'wave'; 96 | this._start = Date.now(); 97 | let mat = this.spImage.getMaterial(name); 98 | 99 | if (!mat) { 100 | const CustomMaterial = require("CustomMaterial"); 101 | mat = new CustomMaterial(name, [ 102 | {name: 'iTime', type: renderer.PARAM_FLOAT}, 103 | {name: 'iOffset', type: renderer.PARAM_FLOAT2} 104 | ]); 105 | this.spImage.setMaterial(name, mat); 106 | } 107 | this.spImage.activateMaterial(name); 108 | mat.setParamValue('iOffset', new cc.Vec2(0, 1.0)); 109 | }, 110 | 111 | onClickBlurs () { 112 | this.resetImage(this.frame1); 113 | const name = 'GaussBlurs'; 114 | let mat = this.spImage.getMaterial(name); 115 | if (!mat) { 116 | const CustomMaterial = require("CustomMaterial"); 117 | mat = new CustomMaterial(name, [ 118 | {name: 'bluramount', type: renderer.PARAM_FLOAT}, 119 | ]); 120 | this.spImage.setMaterial(name, mat); 121 | } 122 | this.spImage.activateMaterial(name); 123 | mat.setParamValue('bluramount', 0.05); 124 | }, 125 | 126 | onClickOutline() { 127 | this.resetImage(this.frame1); 128 | const name = 'Outline'; 129 | let mat = this.spImage.getMaterial(name); 130 | if (!mat) { 131 | const CustomMaterial = require("CustomMaterial"); 132 | mat = new CustomMaterial(name, [ 133 | { name: 'iResolution', type: renderer.PARAM_FLOAT3 }, 134 | ]); 135 | this.spImage.setMaterial(name, mat); 136 | } 137 | this.spImage.activateMaterial(name); 138 | var iResolution = new cc.Vec3(this.spImage.node.width, this.spImage.node.height, 0); 139 | mat.setParamValue("iResolution", iResolution); 140 | }, 141 | 142 | onClickGrowing() { 143 | this.resetImage(this.frame2); 144 | const name = 'Glowing'; 145 | this._start = Date.now(); 146 | let mat = this.spImage.getMaterial(name); 147 | if (!mat) { 148 | const CustomMaterial = require("CustomMaterial"); 149 | mat = new CustomMaterial(name, [ 150 | {name: 'iResolution', type: renderer.PARAM_FLOAT3}, 151 | {name: 'iTime', type: renderer.PARAM_FLOAT}, 152 | ]); 153 | this.spImage.setMaterial(name, mat); 154 | } 155 | this.spImage.node.color = new cc.Color().fromHEX("#1A7ADC") 156 | this.spImage.activateMaterial(name); 157 | var iResolution = new cc.Vec3(this.spImage.node.width, this.spImage.node.height, 0); 158 | mat.setParamValue("iResolution", iResolution); 159 | }, 160 | 161 | onClickWater() { 162 | this.resetImage(this.frame1); 163 | const name = 'Water'; 164 | this._start = Date.now(); 165 | let mat = this.spImage.getMaterial(name); 166 | if (!mat) { 167 | const CustomMaterial = require("CustomMaterial"); 168 | mat = new CustomMaterial(name, [ 169 | {name: 'iResolution', type: renderer.PARAM_FLOAT3}, 170 | {name: 'iTime', type: renderer.PARAM_FLOAT}, 171 | ]); 172 | this.spImage.setMaterial(name, mat); 173 | } 174 | this.spImage.activateMaterial(name); 175 | var iResolution = new cc.Vec3(this.spImage.node.width, this.spImage.node.height, 0); 176 | mat.setParamValue("iResolution", iResolution); 177 | }, 178 | 179 | onClickMosaic() { 180 | this.resetImage(this.frame1); 181 | const name = 'Mosaic'; 182 | this._start = Date.now(); 183 | let mat = this.spImage.getMaterial(name); 184 | if (!mat) { 185 | const CustomMaterial = require("CustomMaterial"); 186 | mat = new CustomMaterial(name, [ 187 | {name: 'iResolution', type: renderer.PARAM_FLOAT3}, 188 | {name: 'mosaicSize', type: renderer.PARAM_FLOAT}, 189 | {name: 'iTime', type: renderer.PARAM_FLOAT}, 190 | ]); 191 | this.spImage.setMaterial(name, mat); 192 | } 193 | this.spImage.activateMaterial(name); 194 | var iResolution = new cc.Vec3(this.spImage.node.width, this.spImage.node.height, 0); 195 | mat.setParamValue("iResolution", iResolution); 196 | mat.setParamValue("mosaicSize", 16); 197 | }, 198 | 199 | onClickRadialBlur() { 200 | this.resetImage(this.frame1); 201 | const name = 'RadialBlur'; 202 | let mat = this.spImage.getMaterial(name); 203 | if (!mat) { 204 | const CustomMaterial = require("CustomMaterial"); 205 | mat = new CustomMaterial(name, [ 206 | {name: 'iResolution', type: renderer.PARAM_FLOAT3}, 207 | {name: 'iCenter', type: renderer.PARAM_FLOAT2}, 208 | ]); 209 | this.spImage.setMaterial(name, mat); 210 | } 211 | this.spImage.activateMaterial(name); 212 | mat.setParamValue("iResolution", new cc.Vec3(this.spImage.node.width, this.spImage.node.height, 0)); 213 | mat.setParamValue("iCenter", new cc.Vec2(0.5, 0.5)); 214 | }, 215 | 216 | update() { 217 | const mat = this.spImage.getCurrMaterial(); 218 | if (!mat) { 219 | return; 220 | } 221 | 222 | if (["rainheart", "wave", "Glowing", "Water"].includes(mat.name)) { 223 | const now = Date.now(); 224 | const time = (now - this._start) / 1000; 225 | mat.setParamValue('iTime', time); 226 | } 227 | }, 228 | }); 229 | -------------------------------------------------------------------------------- /assets/Scripts/main.js.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.5", 3 | "uuid": "7e20e228-2ecb-4d79-a1f8-944bddeb1ac6", 4 | "isPlugin": false, 5 | "loadPluginInWeb": true, 6 | "loadPluginInNative": true, 7 | "loadPluginInEditor": false, 8 | "subMetas": {} 9 | } -------------------------------------------------------------------------------- /assets/Textures.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.1", 3 | "uuid": "d21bb906-40b8-4b56-adff-f2463e010bd2", 4 | "isSubpackage": false, 5 | "subpackageName": "", 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /assets/Textures/image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinsusie/creator_2_0_material_demo/8ab3d754b7906c2b1163b490eec9210327ffd06c/assets/Textures/image.jpg -------------------------------------------------------------------------------- /assets/Textures/image.jpg.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "d277a1a9-1ff5-45a4-bf70-1d2363792992", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "image": { 10 | "ver": "1.0.3", 11 | "uuid": "284cf4f9-b7ef-44c1-ad4f-90e34a6d1db9", 12 | "rawTextureUuid": "d277a1a9-1ff5-45a4-bf70-1d2363792992", 13 | "trimType": "custom", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 960, 21 | "height": 600, 22 | "rawWidth": 960, 23 | "rawHeight": 600, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/Textures/image2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinsusie/creator_2_0_material_demo/8ab3d754b7906c2b1163b490eec9210327ffd06c/assets/Textures/image2.png -------------------------------------------------------------------------------- /assets/Textures/image2.png.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "2.2.0", 3 | "uuid": "323b169a-bbc9-4996-b3fb-b87e070f15c5", 4 | "type": "sprite", 5 | "wrapMode": "clamp", 6 | "filterMode": "bilinear", 7 | "premultiplyAlpha": false, 8 | "subMetas": { 9 | "image2": { 10 | "ver": "1.0.3", 11 | "uuid": "29d5d470-63a5-495e-a5ac-33e1f0a6e10a", 12 | "rawTextureUuid": "323b169a-bbc9-4996-b3fb-b87e070f15c5", 13 | "trimType": "custom", 14 | "trimThreshold": 1, 15 | "rotated": false, 16 | "offsetX": 0, 17 | "offsetY": 0, 18 | "trimX": 0, 19 | "trimY": 0, 20 | "width": 750, 21 | "height": 750, 22 | "rawWidth": 750, 23 | "rawHeight": 750, 24 | "borderTop": 0, 25 | "borderBottom": 0, 26 | "borderLeft": 0, 27 | "borderRight": 0, 28 | "subMetas": {} 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /assets/main.fire: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__type__": "cc.SceneAsset", 4 | "_name": "", 5 | "_objFlags": 0, 6 | "_native": "", 7 | "scene": { 8 | "__id__": 1 9 | } 10 | }, 11 | { 12 | "__type__": "cc.Scene", 13 | "_objFlags": 0, 14 | "_parent": null, 15 | "_children": [ 16 | { 17 | "__id__": 2 18 | } 19 | ], 20 | "_active": true, 21 | "_level": 0, 22 | "_components": [], 23 | "_prefab": null, 24 | "_opacity": 255, 25 | "_color": { 26 | "__type__": "cc.Color", 27 | "r": 255, 28 | "g": 255, 29 | "b": 255, 30 | "a": 255 31 | }, 32 | "_contentSize": { 33 | "__type__": "cc.Size", 34 | "width": 0, 35 | "height": 0 36 | }, 37 | "_anchorPoint": { 38 | "__type__": "cc.Vec2", 39 | "x": 0, 40 | "y": 0 41 | }, 42 | "_scale": { 43 | "__type__": "cc.Vec3", 44 | "x": 0.73670654296875, 45 | "y": 0.73670654296875, 46 | "z": 1 47 | }, 48 | "_quat": { 49 | "__type__": "cc.Quat", 50 | "x": 0, 51 | "y": 0, 52 | "z": 0, 53 | "w": 1 54 | }, 55 | "_zIndex": 0, 56 | "groupIndex": 0, 57 | "autoReleaseAssets": false, 58 | "_id": "9015cc34-89b1-488e-ae74-1186411646cc" 59 | }, 60 | { 61 | "__type__": "cc.Node", 62 | "_name": "Canvas", 63 | "_objFlags": 0, 64 | "_parent": { 65 | "__id__": 1 66 | }, 67 | "_children": [ 68 | { 69 | "__id__": 3 70 | }, 71 | { 72 | "__id__": 5 73 | }, 74 | { 75 | "__id__": 8 76 | }, 77 | { 78 | "__id__": 10 79 | }, 80 | { 81 | "__id__": 16 82 | }, 83 | { 84 | "__id__": 22 85 | }, 86 | { 87 | "__id__": 28 88 | }, 89 | { 90 | "__id__": 34 91 | }, 92 | { 93 | "__id__": 40 94 | }, 95 | { 96 | "__id__": 46 97 | }, 98 | { 99 | "__id__": 52 100 | }, 101 | { 102 | "__id__": 58 103 | }, 104 | { 105 | "__id__": 64 106 | }, 107 | { 108 | "__id__": 70 109 | } 110 | ], 111 | "_active": true, 112 | "_level": 1, 113 | "_components": [ 114 | { 115 | "__id__": 76 116 | }, 117 | { 118 | "__id__": 77 119 | } 120 | ], 121 | "_prefab": null, 122 | "_opacity": 255, 123 | "_color": { 124 | "__type__": "cc.Color", 125 | "r": 255, 126 | "g": 255, 127 | "b": 255, 128 | "a": 255 129 | }, 130 | "_contentSize": { 131 | "__type__": "cc.Size", 132 | "width": 1280, 133 | "height": 720 134 | }, 135 | "_anchorPoint": { 136 | "__type__": "cc.Vec2", 137 | "x": 0.5, 138 | "y": 0.5 139 | }, 140 | "_position": { 141 | "__type__": "cc.Vec3", 142 | "x": 640, 143 | "y": 360, 144 | "z": 0 145 | }, 146 | "_scale": { 147 | "__type__": "cc.Vec3", 148 | "x": 1, 149 | "y": 1, 150 | "z": 1 151 | }, 152 | "_rotationX": 0, 153 | "_rotationY": 0, 154 | "_quat": { 155 | "__type__": "cc.Quat", 156 | "x": 0, 157 | "y": 0, 158 | "z": 0, 159 | "w": 1 160 | }, 161 | "_skewX": 0, 162 | "_skewY": 0, 163 | "_zIndex": 0, 164 | "groupIndex": 0, 165 | "_id": "c64rfAy2hFNaTxfDeq4BOV" 166 | }, 167 | { 168 | "__type__": "cc.Node", 169 | "_name": "Main Camera", 170 | "_objFlags": 0, 171 | "_parent": { 172 | "__id__": 2 173 | }, 174 | "_children": [], 175 | "_active": true, 176 | "_level": 2, 177 | "_components": [ 178 | { 179 | "__id__": 4 180 | } 181 | ], 182 | "_prefab": null, 183 | "_opacity": 255, 184 | "_color": { 185 | "__type__": "cc.Color", 186 | "r": 255, 187 | "g": 255, 188 | "b": 255, 189 | "a": 255 190 | }, 191 | "_contentSize": { 192 | "__type__": "cc.Size", 193 | "width": 0, 194 | "height": 0 195 | }, 196 | "_anchorPoint": { 197 | "__type__": "cc.Vec2", 198 | "x": 0.5, 199 | "y": 0.5 200 | }, 201 | "_position": { 202 | "__type__": "cc.Vec3", 203 | "x": 0, 204 | "y": 0, 205 | "z": 0 206 | }, 207 | "_scale": { 208 | "__type__": "cc.Vec3", 209 | "x": 1, 210 | "y": 1, 211 | "z": 1 212 | }, 213 | "_rotationX": 0, 214 | "_rotationY": 0, 215 | "_quat": { 216 | "__type__": "cc.Quat", 217 | "x": 0, 218 | "y": 0, 219 | "z": 0, 220 | "w": 1 221 | }, 222 | "_skewX": 0, 223 | "_skewY": 0, 224 | "_zIndex": 0, 225 | "groupIndex": 0, 226 | "_id": "c2dbUEZ+5BGIIduReDIFWO" 227 | }, 228 | { 229 | "__type__": "cc.Camera", 230 | "_name": "", 231 | "_objFlags": 0, 232 | "node": { 233 | "__id__": 3 234 | }, 235 | "_enabled": true, 236 | "_cullingMask": 4294967295, 237 | "_clearFlags": 7, 238 | "_backgroundColor": { 239 | "__type__": "cc.Color", 240 | "r": 0, 241 | "g": 0, 242 | "b": 0, 243 | "a": 255 244 | }, 245 | "_depth": -1, 246 | "_zoomRatio": 1, 247 | "_targetTexture": null, 248 | "_id": "0f1OUlUTBGUJb2blZ8uoHW" 249 | }, 250 | { 251 | "__type__": "cc.Node", 252 | "_name": "New Sprite(Splash)", 253 | "_objFlags": 0, 254 | "_parent": { 255 | "__id__": 2 256 | }, 257 | "_children": [], 258 | "_active": true, 259 | "_level": 2, 260 | "_components": [ 261 | { 262 | "__id__": 6 263 | }, 264 | { 265 | "__id__": 7 266 | } 267 | ], 268 | "_prefab": null, 269 | "_opacity": 255, 270 | "_color": { 271 | "__type__": "cc.Color", 272 | "r": 255, 273 | "g": 255, 274 | "b": 255, 275 | "a": 255 276 | }, 277 | "_contentSize": { 278 | "__type__": "cc.Size", 279 | "width": 1280, 280 | "height": 720 281 | }, 282 | "_anchorPoint": { 283 | "__type__": "cc.Vec2", 284 | "x": 0.5, 285 | "y": 0.5 286 | }, 287 | "_position": { 288 | "__type__": "cc.Vec3", 289 | "x": 0, 290 | "y": 0, 291 | "z": 0 292 | }, 293 | "_scale": { 294 | "__type__": "cc.Vec3", 295 | "x": 1, 296 | "y": 1, 297 | "z": 1 298 | }, 299 | "_rotationX": 0, 300 | "_rotationY": 0, 301 | "_quat": { 302 | "__type__": "cc.Quat", 303 | "x": 0, 304 | "y": 0, 305 | "z": 0, 306 | "w": 1 307 | }, 308 | "_skewX": 0, 309 | "_skewY": 0, 310 | "_zIndex": 0, 311 | "groupIndex": 0, 312 | "_id": "12B+OxAg5CzKqy8MYigKYf" 313 | }, 314 | { 315 | "__type__": "cc.Sprite", 316 | "_name": "", 317 | "_objFlags": 0, 318 | "node": { 319 | "__id__": 5 320 | }, 321 | "_enabled": true, 322 | "_srcBlendFactor": 770, 323 | "_dstBlendFactor": 771, 324 | "_spriteFrame": { 325 | "__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91" 326 | }, 327 | "_type": 0, 328 | "_sizeMode": 0, 329 | "_fillType": 0, 330 | "_fillCenter": { 331 | "__type__": "cc.Vec2", 332 | "x": 0, 333 | "y": 0 334 | }, 335 | "_fillStart": 0, 336 | "_fillRange": 0, 337 | "_isTrimmedMode": true, 338 | "_state": 0, 339 | "_atlas": null, 340 | "_id": "b89wsLndhD1oG4mRuzRRhM" 341 | }, 342 | { 343 | "__type__": "cc.Widget", 344 | "_name": "", 345 | "_objFlags": 0, 346 | "node": { 347 | "__id__": 5 348 | }, 349 | "_enabled": true, 350 | "alignMode": 1, 351 | "_target": null, 352 | "_alignFlags": 45, 353 | "_left": 0, 354 | "_right": 0, 355 | "_top": 0, 356 | "_bottom": 0, 357 | "_verticalCenter": 0, 358 | "_horizontalCenter": 0, 359 | "_isAbsLeft": true, 360 | "_isAbsRight": true, 361 | "_isAbsTop": true, 362 | "_isAbsBottom": true, 363 | "_isAbsHorizontalCenter": true, 364 | "_isAbsVerticalCenter": true, 365 | "_originalWidth": 100, 366 | "_originalHeight": 100, 367 | "_id": "16LPgHrdJMVoGc/VXcVg+n" 368 | }, 369 | { 370 | "__type__": "cc.Node", 371 | "_name": "spImage", 372 | "_objFlags": 0, 373 | "_parent": { 374 | "__id__": 2 375 | }, 376 | "_children": [], 377 | "_active": true, 378 | "_level": 2, 379 | "_components": [ 380 | { 381 | "__id__": 9 382 | } 383 | ], 384 | "_prefab": null, 385 | "_opacity": 255, 386 | "_color": { 387 | "__type__": "cc.Color", 388 | "r": 255, 389 | "g": 255, 390 | "b": 255, 391 | "a": 255 392 | }, 393 | "_contentSize": { 394 | "__type__": "cc.Size", 395 | "width": 960, 396 | "height": 600 397 | }, 398 | "_anchorPoint": { 399 | "__type__": "cc.Vec2", 400 | "x": 0.5, 401 | "y": 0.5 402 | }, 403 | "_position": { 404 | "__type__": "cc.Vec3", 405 | "x": 3, 406 | "y": 46, 407 | "z": 0 408 | }, 409 | "_scale": { 410 | "__type__": "cc.Vec3", 411 | "x": 1, 412 | "y": 1, 413 | "z": 1 414 | }, 415 | "_rotationX": 0, 416 | "_rotationY": 0, 417 | "_quat": { 418 | "__type__": "cc.Quat", 419 | "x": 0, 420 | "y": 0, 421 | "z": 0, 422 | "w": 1 423 | }, 424 | "_skewX": 0, 425 | "_skewY": 0, 426 | "_zIndex": 0, 427 | "groupIndex": 0, 428 | "_id": "5ejv0nhpZC648z/jYqt4hk" 429 | }, 430 | { 431 | "__type__": "cc.Sprite", 432 | "_name": "", 433 | "_objFlags": 0, 434 | "node": { 435 | "__id__": 8 436 | }, 437 | "_enabled": true, 438 | "_srcBlendFactor": 770, 439 | "_dstBlendFactor": 771, 440 | "_spriteFrame": { 441 | "__uuid__": "284cf4f9-b7ef-44c1-ad4f-90e34a6d1db9" 442 | }, 443 | "_type": 0, 444 | "_sizeMode": 1, 445 | "_fillType": 0, 446 | "_fillCenter": { 447 | "__type__": "cc.Vec2", 448 | "x": 0, 449 | "y": 0 450 | }, 451 | "_fillStart": 0, 452 | "_fillRange": 0, 453 | "_isTrimmedMode": true, 454 | "_state": 0, 455 | "_atlas": null, 456 | "_id": "47sAadO91KY4cCK37VNg3x" 457 | }, 458 | { 459 | "__type__": "cc.Node", 460 | "_name": "btnNormal", 461 | "_objFlags": 0, 462 | "_parent": { 463 | "__id__": 2 464 | }, 465 | "_children": [ 466 | { 467 | "__id__": 11 468 | } 469 | ], 470 | "_active": true, 471 | "_level": 2, 472 | "_components": [ 473 | { 474 | "__id__": 13 475 | }, 476 | { 477 | "__id__": 14 478 | } 479 | ], 480 | "_prefab": null, 481 | "_opacity": 255, 482 | "_color": { 483 | "__type__": "cc.Color", 484 | "r": 255, 485 | "g": 255, 486 | "b": 255, 487 | "a": 255 488 | }, 489 | "_contentSize": { 490 | "__type__": "cc.Size", 491 | "width": 100, 492 | "height": 40 493 | }, 494 | "_anchorPoint": { 495 | "__type__": "cc.Vec2", 496 | "x": 0.5, 497 | "y": 0.5 498 | }, 499 | "_position": { 500 | "__type__": "cc.Vec3", 501 | "x": -292, 502 | "y": -251, 503 | "z": 0 504 | }, 505 | "_scale": { 506 | "__type__": "cc.Vec3", 507 | "x": 1, 508 | "y": 1, 509 | "z": 1 510 | }, 511 | "_rotationX": 0, 512 | "_rotationY": 0, 513 | "_quat": { 514 | "__type__": "cc.Quat", 515 | "x": 0, 516 | "y": 0, 517 | "z": 0, 518 | "w": 1 519 | }, 520 | "_skewX": 0, 521 | "_skewY": 0, 522 | "_zIndex": 0, 523 | "groupIndex": 0, 524 | "_id": "22MpMojnVAKZ2gv9LuC/M9" 525 | }, 526 | { 527 | "__type__": "cc.Node", 528 | "_name": "Label", 529 | "_objFlags": 0, 530 | "_parent": { 531 | "__id__": 10 532 | }, 533 | "_children": [], 534 | "_active": true, 535 | "_level": 0, 536 | "_components": [ 537 | { 538 | "__id__": 12 539 | } 540 | ], 541 | "_prefab": null, 542 | "_opacity": 255, 543 | "_color": { 544 | "__type__": "cc.Color", 545 | "r": 0, 546 | "g": 0, 547 | "b": 0, 548 | "a": 255 549 | }, 550 | "_contentSize": { 551 | "__type__": "cc.Size", 552 | "width": 100, 553 | "height": 40 554 | }, 555 | "_anchorPoint": { 556 | "__type__": "cc.Vec2", 557 | "x": 0.5, 558 | "y": 0.5 559 | }, 560 | "_position": { 561 | "__type__": "cc.Vec3", 562 | "x": 0, 563 | "y": 0, 564 | "z": 0 565 | }, 566 | "_scale": { 567 | "__type__": "cc.Vec3", 568 | "x": 1, 569 | "y": 1, 570 | "z": 1 571 | }, 572 | "_rotationX": 0, 573 | "_rotationY": 0, 574 | "_quat": { 575 | "__type__": "cc.Quat", 576 | "x": 0, 577 | "y": 0, 578 | "z": 0, 579 | "w": 1 580 | }, 581 | "_skewX": 0, 582 | "_skewY": 0, 583 | "_zIndex": 0, 584 | "groupIndex": 0, 585 | "_id": "ebW2kxh5hGWos//RQ8q24u" 586 | }, 587 | { 588 | "__type__": "cc.Label", 589 | "_name": "", 590 | "_objFlags": 0, 591 | "node": { 592 | "__id__": 11 593 | }, 594 | "_enabled": true, 595 | "_srcBlendFactor": 1, 596 | "_dstBlendFactor": 771, 597 | "_useOriginalSize": false, 598 | "_string": "正常", 599 | "_N$string": "正常", 600 | "_fontSize": 20, 601 | "_lineHeight": 40, 602 | "_enableWrapText": false, 603 | "_N$file": null, 604 | "_isSystemFontUsed": true, 605 | "_spacingX": 0, 606 | "_N$horizontalAlign": 1, 607 | "_N$verticalAlign": 1, 608 | "_N$fontFamily": "Arial", 609 | "_N$overflow": 1, 610 | "_id": "88LcXj03ZDIqKzTyIYZyax" 611 | }, 612 | { 613 | "__type__": "cc.Sprite", 614 | "_name": "", 615 | "_objFlags": 0, 616 | "node": { 617 | "__id__": 10 618 | }, 619 | "_enabled": true, 620 | "_srcBlendFactor": 770, 621 | "_dstBlendFactor": 771, 622 | "_spriteFrame": { 623 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 624 | }, 625 | "_type": 1, 626 | "_sizeMode": 0, 627 | "_fillType": 0, 628 | "_fillCenter": { 629 | "__type__": "cc.Vec2", 630 | "x": 0, 631 | "y": 0 632 | }, 633 | "_fillStart": 0, 634 | "_fillRange": 0, 635 | "_isTrimmedMode": true, 636 | "_state": 0, 637 | "_atlas": null, 638 | "_id": "aamegVWJlFjZZYg0+Lyfv6" 639 | }, 640 | { 641 | "__type__": "cc.Button", 642 | "_name": "", 643 | "_objFlags": 0, 644 | "node": { 645 | "__id__": 10 646 | }, 647 | "_enabled": true, 648 | "transition": 2, 649 | "pressedColor": { 650 | "__type__": "cc.Color", 651 | "r": 255, 652 | "g": 255, 653 | "b": 255, 654 | "a": 255 655 | }, 656 | "hoverColor": { 657 | "__type__": "cc.Color", 658 | "r": 255, 659 | "g": 255, 660 | "b": 255, 661 | "a": 255 662 | }, 663 | "duration": 0.1, 664 | "zoomScale": 1.2, 665 | "clickEvents": [ 666 | { 667 | "__id__": 15 668 | } 669 | ], 670 | "_N$interactable": true, 671 | "_N$enableAutoGrayEffect": false, 672 | "_N$normalColor": { 673 | "__type__": "cc.Color", 674 | "r": 255, 675 | "g": 255, 676 | "b": 255, 677 | "a": 255 678 | }, 679 | "_N$disabledColor": { 680 | "__type__": "cc.Color", 681 | "r": 255, 682 | "g": 255, 683 | "b": 255, 684 | "a": 255 685 | }, 686 | "_N$normalSprite": { 687 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 688 | }, 689 | "_N$pressedSprite": { 690 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 691 | }, 692 | "pressedSprite": { 693 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 694 | }, 695 | "_N$hoverSprite": { 696 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 697 | }, 698 | "hoverSprite": { 699 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 700 | }, 701 | "_N$disabledSprite": { 702 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 703 | }, 704 | "_N$target": { 705 | "__id__": 10 706 | }, 707 | "_id": "a5v7z+OclMIZb2fPsxaBV2" 708 | }, 709 | { 710 | "__type__": "cc.ClickEvent", 711 | "target": { 712 | "__id__": 2 713 | }, 714 | "component": "main", 715 | "handler": "onClickNormal", 716 | "customEventData": "" 717 | }, 718 | { 719 | "__type__": "cc.Node", 720 | "_name": "btnGray", 721 | "_objFlags": 0, 722 | "_parent": { 723 | "__id__": 2 724 | }, 725 | "_children": [ 726 | { 727 | "__id__": 17 728 | } 729 | ], 730 | "_active": true, 731 | "_level": 2, 732 | "_components": [ 733 | { 734 | "__id__": 19 735 | }, 736 | { 737 | "__id__": 20 738 | } 739 | ], 740 | "_prefab": null, 741 | "_opacity": 255, 742 | "_color": { 743 | "__type__": "cc.Color", 744 | "r": 255, 745 | "g": 255, 746 | "b": 255, 747 | "a": 255 748 | }, 749 | "_contentSize": { 750 | "__type__": "cc.Size", 751 | "width": 100, 752 | "height": 40 753 | }, 754 | "_anchorPoint": { 755 | "__type__": "cc.Vec2", 756 | "x": 0.5, 757 | "y": 0.5 758 | }, 759 | "_position": { 760 | "__type__": "cc.Vec3", 761 | "x": -155, 762 | "y": -251, 763 | "z": 0 764 | }, 765 | "_scale": { 766 | "__type__": "cc.Vec3", 767 | "x": 1, 768 | "y": 1, 769 | "z": 1 770 | }, 771 | "_rotationX": 0, 772 | "_rotationY": 0, 773 | "_quat": { 774 | "__type__": "cc.Quat", 775 | "x": 0, 776 | "y": 0, 777 | "z": 0, 778 | "w": 1 779 | }, 780 | "_skewX": 0, 781 | "_skewY": 0, 782 | "_zIndex": 0, 783 | "groupIndex": 0, 784 | "_id": "b3+2WcwD9OtJHs1qUM0frG" 785 | }, 786 | { 787 | "__type__": "cc.Node", 788 | "_name": "Label", 789 | "_objFlags": 0, 790 | "_parent": { 791 | "__id__": 16 792 | }, 793 | "_children": [], 794 | "_active": true, 795 | "_level": 0, 796 | "_components": [ 797 | { 798 | "__id__": 18 799 | } 800 | ], 801 | "_prefab": null, 802 | "_opacity": 255, 803 | "_color": { 804 | "__type__": "cc.Color", 805 | "r": 0, 806 | "g": 0, 807 | "b": 0, 808 | "a": 255 809 | }, 810 | "_contentSize": { 811 | "__type__": "cc.Size", 812 | "width": 100, 813 | "height": 40 814 | }, 815 | "_anchorPoint": { 816 | "__type__": "cc.Vec2", 817 | "x": 0.5, 818 | "y": 0.5 819 | }, 820 | "_position": { 821 | "__type__": "cc.Vec3", 822 | "x": 0, 823 | "y": 0, 824 | "z": 0 825 | }, 826 | "_scale": { 827 | "__type__": "cc.Vec3", 828 | "x": 1, 829 | "y": 1, 830 | "z": 1 831 | }, 832 | "_rotationX": 0, 833 | "_rotationY": 0, 834 | "_quat": { 835 | "__type__": "cc.Quat", 836 | "x": 0, 837 | "y": 0, 838 | "z": 0, 839 | "w": 1 840 | }, 841 | "_skewX": 0, 842 | "_skewY": 0, 843 | "_zIndex": 0, 844 | "groupIndex": 0, 845 | "_id": "5790un5hlC14e6y79cgxkM" 846 | }, 847 | { 848 | "__type__": "cc.Label", 849 | "_name": "", 850 | "_objFlags": 0, 851 | "node": { 852 | "__id__": 17 853 | }, 854 | "_enabled": true, 855 | "_srcBlendFactor": 1, 856 | "_dstBlendFactor": 771, 857 | "_useOriginalSize": false, 858 | "_string": "变灰", 859 | "_N$string": "变灰", 860 | "_fontSize": 20, 861 | "_lineHeight": 40, 862 | "_enableWrapText": false, 863 | "_N$file": null, 864 | "_isSystemFontUsed": true, 865 | "_spacingX": 0, 866 | "_N$horizontalAlign": 1, 867 | "_N$verticalAlign": 1, 868 | "_N$fontFamily": "Arial", 869 | "_N$overflow": 1, 870 | "_id": "d9sFsXV/RB8pCwDvVsUq3y" 871 | }, 872 | { 873 | "__type__": "cc.Sprite", 874 | "_name": "", 875 | "_objFlags": 0, 876 | "node": { 877 | "__id__": 16 878 | }, 879 | "_enabled": true, 880 | "_srcBlendFactor": 770, 881 | "_dstBlendFactor": 771, 882 | "_spriteFrame": { 883 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 884 | }, 885 | "_type": 1, 886 | "_sizeMode": 0, 887 | "_fillType": 0, 888 | "_fillCenter": { 889 | "__type__": "cc.Vec2", 890 | "x": 0, 891 | "y": 0 892 | }, 893 | "_fillStart": 0, 894 | "_fillRange": 0, 895 | "_isTrimmedMode": true, 896 | "_state": 0, 897 | "_atlas": null, 898 | "_id": "6dnE82unxC1ofY25JUv60S" 899 | }, 900 | { 901 | "__type__": "cc.Button", 902 | "_name": "", 903 | "_objFlags": 0, 904 | "node": { 905 | "__id__": 16 906 | }, 907 | "_enabled": true, 908 | "transition": 2, 909 | "pressedColor": { 910 | "__type__": "cc.Color", 911 | "r": 255, 912 | "g": 255, 913 | "b": 255, 914 | "a": 255 915 | }, 916 | "hoverColor": { 917 | "__type__": "cc.Color", 918 | "r": 255, 919 | "g": 255, 920 | "b": 255, 921 | "a": 255 922 | }, 923 | "duration": 0.1, 924 | "zoomScale": 1.2, 925 | "clickEvents": [ 926 | { 927 | "__id__": 21 928 | } 929 | ], 930 | "_N$interactable": true, 931 | "_N$enableAutoGrayEffect": false, 932 | "_N$normalColor": { 933 | "__type__": "cc.Color", 934 | "r": 255, 935 | "g": 255, 936 | "b": 255, 937 | "a": 255 938 | }, 939 | "_N$disabledColor": { 940 | "__type__": "cc.Color", 941 | "r": 255, 942 | "g": 255, 943 | "b": 255, 944 | "a": 255 945 | }, 946 | "_N$normalSprite": { 947 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 948 | }, 949 | "_N$pressedSprite": { 950 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 951 | }, 952 | "pressedSprite": { 953 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 954 | }, 955 | "_N$hoverSprite": { 956 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 957 | }, 958 | "hoverSprite": { 959 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 960 | }, 961 | "_N$disabledSprite": { 962 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 963 | }, 964 | "_N$target": { 965 | "__id__": 16 966 | }, 967 | "_id": "451oZwt4hE+bwxCE82OucN" 968 | }, 969 | { 970 | "__type__": "cc.ClickEvent", 971 | "target": { 972 | "__id__": 2 973 | }, 974 | "component": "main", 975 | "handler": "onClickGray", 976 | "customEventData": "" 977 | }, 978 | { 979 | "__type__": "cc.Node", 980 | "_name": "btnOverlay", 981 | "_objFlags": 0, 982 | "_parent": { 983 | "__id__": 2 984 | }, 985 | "_children": [ 986 | { 987 | "__id__": 23 988 | } 989 | ], 990 | "_active": true, 991 | "_level": 2, 992 | "_components": [ 993 | { 994 | "__id__": 25 995 | }, 996 | { 997 | "__id__": 26 998 | } 999 | ], 1000 | "_prefab": null, 1001 | "_opacity": 255, 1002 | "_color": { 1003 | "__type__": "cc.Color", 1004 | "r": 255, 1005 | "g": 255, 1006 | "b": 255, 1007 | "a": 255 1008 | }, 1009 | "_contentSize": { 1010 | "__type__": "cc.Size", 1011 | "width": 100, 1012 | "height": 40 1013 | }, 1014 | "_anchorPoint": { 1015 | "__type__": "cc.Vec2", 1016 | "x": 0.5, 1017 | "y": 0.5 1018 | }, 1019 | "_position": { 1020 | "__type__": "cc.Vec3", 1021 | "x": -17, 1022 | "y": -251, 1023 | "z": 0 1024 | }, 1025 | "_scale": { 1026 | "__type__": "cc.Vec3", 1027 | "x": 1, 1028 | "y": 1, 1029 | "z": 1 1030 | }, 1031 | "_rotationX": 0, 1032 | "_rotationY": 0, 1033 | "_quat": { 1034 | "__type__": "cc.Quat", 1035 | "x": 0, 1036 | "y": 0, 1037 | "z": 0, 1038 | "w": 1 1039 | }, 1040 | "_skewX": 0, 1041 | "_skewY": 0, 1042 | "_zIndex": 0, 1043 | "groupIndex": 0, 1044 | "_id": "27YaY2qTNAe4PvyE0GAan1" 1045 | }, 1046 | { 1047 | "__type__": "cc.Node", 1048 | "_name": "Label", 1049 | "_objFlags": 0, 1050 | "_parent": { 1051 | "__id__": 22 1052 | }, 1053 | "_children": [], 1054 | "_active": true, 1055 | "_level": 0, 1056 | "_components": [ 1057 | { 1058 | "__id__": 24 1059 | } 1060 | ], 1061 | "_prefab": null, 1062 | "_opacity": 255, 1063 | "_color": { 1064 | "__type__": "cc.Color", 1065 | "r": 0, 1066 | "g": 0, 1067 | "b": 0, 1068 | "a": 255 1069 | }, 1070 | "_contentSize": { 1071 | "__type__": "cc.Size", 1072 | "width": 100, 1073 | "height": 40 1074 | }, 1075 | "_anchorPoint": { 1076 | "__type__": "cc.Vec2", 1077 | "x": 0.5, 1078 | "y": 0.5 1079 | }, 1080 | "_position": { 1081 | "__type__": "cc.Vec3", 1082 | "x": 0, 1083 | "y": 0, 1084 | "z": 0 1085 | }, 1086 | "_scale": { 1087 | "__type__": "cc.Vec3", 1088 | "x": 1, 1089 | "y": 1, 1090 | "z": 1 1091 | }, 1092 | "_rotationX": 0, 1093 | "_rotationY": 0, 1094 | "_quat": { 1095 | "__type__": "cc.Quat", 1096 | "x": 0, 1097 | "y": 0, 1098 | "z": 0, 1099 | "w": 1 1100 | }, 1101 | "_skewX": 0, 1102 | "_skewY": 0, 1103 | "_zIndex": 0, 1104 | "groupIndex": 0, 1105 | "_id": "d1cD/u3R1Mio5MzaWqb1zo" 1106 | }, 1107 | { 1108 | "__type__": "cc.Label", 1109 | "_name": "", 1110 | "_objFlags": 0, 1111 | "node": { 1112 | "__id__": 23 1113 | }, 1114 | "_enabled": true, 1115 | "_srcBlendFactor": 1, 1116 | "_dstBlendFactor": 771, 1117 | "_useOriginalSize": false, 1118 | "_string": "高亮", 1119 | "_N$string": "高亮", 1120 | "_fontSize": 20, 1121 | "_lineHeight": 40, 1122 | "_enableWrapText": false, 1123 | "_N$file": null, 1124 | "_isSystemFontUsed": true, 1125 | "_spacingX": 0, 1126 | "_N$horizontalAlign": 1, 1127 | "_N$verticalAlign": 1, 1128 | "_N$fontFamily": "Arial", 1129 | "_N$overflow": 1, 1130 | "_id": "95/XIdM/1IebrrfkgbUCcY" 1131 | }, 1132 | { 1133 | "__type__": "cc.Sprite", 1134 | "_name": "", 1135 | "_objFlags": 0, 1136 | "node": { 1137 | "__id__": 22 1138 | }, 1139 | "_enabled": true, 1140 | "_srcBlendFactor": 770, 1141 | "_dstBlendFactor": 771, 1142 | "_spriteFrame": { 1143 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1144 | }, 1145 | "_type": 1, 1146 | "_sizeMode": 0, 1147 | "_fillType": 0, 1148 | "_fillCenter": { 1149 | "__type__": "cc.Vec2", 1150 | "x": 0, 1151 | "y": 0 1152 | }, 1153 | "_fillStart": 0, 1154 | "_fillRange": 0, 1155 | "_isTrimmedMode": true, 1156 | "_state": 0, 1157 | "_atlas": null, 1158 | "_id": "d2FpePZDpG4r75bBQU1wLm" 1159 | }, 1160 | { 1161 | "__type__": "cc.Button", 1162 | "_name": "", 1163 | "_objFlags": 0, 1164 | "node": { 1165 | "__id__": 22 1166 | }, 1167 | "_enabled": true, 1168 | "transition": 2, 1169 | "pressedColor": { 1170 | "__type__": "cc.Color", 1171 | "r": 255, 1172 | "g": 255, 1173 | "b": 255, 1174 | "a": 255 1175 | }, 1176 | "hoverColor": { 1177 | "__type__": "cc.Color", 1178 | "r": 255, 1179 | "g": 255, 1180 | "b": 255, 1181 | "a": 255 1182 | }, 1183 | "duration": 0.1, 1184 | "zoomScale": 1.2, 1185 | "clickEvents": [ 1186 | { 1187 | "__id__": 27 1188 | } 1189 | ], 1190 | "_N$interactable": true, 1191 | "_N$enableAutoGrayEffect": false, 1192 | "_N$normalColor": { 1193 | "__type__": "cc.Color", 1194 | "r": 255, 1195 | "g": 255, 1196 | "b": 255, 1197 | "a": 255 1198 | }, 1199 | "_N$disabledColor": { 1200 | "__type__": "cc.Color", 1201 | "r": 255, 1202 | "g": 255, 1203 | "b": 255, 1204 | "a": 255 1205 | }, 1206 | "_N$normalSprite": { 1207 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1208 | }, 1209 | "_N$pressedSprite": { 1210 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1211 | }, 1212 | "pressedSprite": { 1213 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1214 | }, 1215 | "_N$hoverSprite": { 1216 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1217 | }, 1218 | "hoverSprite": { 1219 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1220 | }, 1221 | "_N$disabledSprite": { 1222 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 1223 | }, 1224 | "_N$target": { 1225 | "__id__": 22 1226 | }, 1227 | "_id": "8aBIX8WcVKbZ24XtFPiezc" 1228 | }, 1229 | { 1230 | "__type__": "cc.ClickEvent", 1231 | "target": { 1232 | "__id__": 2 1233 | }, 1234 | "component": "main", 1235 | "handler": "onClickOverlay", 1236 | "customEventData": "" 1237 | }, 1238 | { 1239 | "__type__": "cc.Node", 1240 | "_name": "btnRain", 1241 | "_objFlags": 0, 1242 | "_parent": { 1243 | "__id__": 2 1244 | }, 1245 | "_children": [ 1246 | { 1247 | "__id__": 29 1248 | } 1249 | ], 1250 | "_active": true, 1251 | "_level": 2, 1252 | "_components": [ 1253 | { 1254 | "__id__": 31 1255 | }, 1256 | { 1257 | "__id__": 32 1258 | } 1259 | ], 1260 | "_prefab": null, 1261 | "_opacity": 255, 1262 | "_color": { 1263 | "__type__": "cc.Color", 1264 | "r": 255, 1265 | "g": 255, 1266 | "b": 255, 1267 | "a": 255 1268 | }, 1269 | "_contentSize": { 1270 | "__type__": "cc.Size", 1271 | "width": 100, 1272 | "height": 40 1273 | }, 1274 | "_anchorPoint": { 1275 | "__type__": "cc.Vec2", 1276 | "x": 0.5, 1277 | "y": 0.5 1278 | }, 1279 | "_position": { 1280 | "__type__": "cc.Vec3", 1281 | "x": 120, 1282 | "y": -251, 1283 | "z": 0 1284 | }, 1285 | "_scale": { 1286 | "__type__": "cc.Vec3", 1287 | "x": 1, 1288 | "y": 1, 1289 | "z": 1 1290 | }, 1291 | "_rotationX": 0, 1292 | "_rotationY": 0, 1293 | "_quat": { 1294 | "__type__": "cc.Quat", 1295 | "x": 0, 1296 | "y": 0, 1297 | "z": 0, 1298 | "w": 1 1299 | }, 1300 | "_skewX": 0, 1301 | "_skewY": 0, 1302 | "_zIndex": 0, 1303 | "groupIndex": 0, 1304 | "_id": "98XfE78RVHhawHZLrxguOo" 1305 | }, 1306 | { 1307 | "__type__": "cc.Node", 1308 | "_name": "Label", 1309 | "_objFlags": 0, 1310 | "_parent": { 1311 | "__id__": 28 1312 | }, 1313 | "_children": [], 1314 | "_active": true, 1315 | "_level": 0, 1316 | "_components": [ 1317 | { 1318 | "__id__": 30 1319 | } 1320 | ], 1321 | "_prefab": null, 1322 | "_opacity": 255, 1323 | "_color": { 1324 | "__type__": "cc.Color", 1325 | "r": 0, 1326 | "g": 0, 1327 | "b": 0, 1328 | "a": 255 1329 | }, 1330 | "_contentSize": { 1331 | "__type__": "cc.Size", 1332 | "width": 100, 1333 | "height": 40 1334 | }, 1335 | "_anchorPoint": { 1336 | "__type__": "cc.Vec2", 1337 | "x": 0.5, 1338 | "y": 0.5 1339 | }, 1340 | "_position": { 1341 | "__type__": "cc.Vec3", 1342 | "x": 0, 1343 | "y": 0, 1344 | "z": 0 1345 | }, 1346 | "_scale": { 1347 | "__type__": "cc.Vec3", 1348 | "x": 1, 1349 | "y": 1, 1350 | "z": 1 1351 | }, 1352 | "_rotationX": 0, 1353 | "_rotationY": 0, 1354 | "_quat": { 1355 | "__type__": "cc.Quat", 1356 | "x": 0, 1357 | "y": 0, 1358 | "z": 0, 1359 | "w": 1 1360 | }, 1361 | "_skewX": 0, 1362 | "_skewY": 0, 1363 | "_zIndex": 0, 1364 | "groupIndex": 0, 1365 | "_id": "88AiTlB3xHqawP1YPtrDe7" 1366 | }, 1367 | { 1368 | "__type__": "cc.Label", 1369 | "_name": "", 1370 | "_objFlags": 0, 1371 | "node": { 1372 | "__id__": 29 1373 | }, 1374 | "_enabled": true, 1375 | "_srcBlendFactor": 1, 1376 | "_dstBlendFactor": 771, 1377 | "_useOriginalSize": false, 1378 | "_string": "雨效果", 1379 | "_N$string": "雨效果", 1380 | "_fontSize": 20, 1381 | "_lineHeight": 40, 1382 | "_enableWrapText": false, 1383 | "_N$file": null, 1384 | "_isSystemFontUsed": true, 1385 | "_spacingX": 0, 1386 | "_N$horizontalAlign": 1, 1387 | "_N$verticalAlign": 1, 1388 | "_N$fontFamily": "Arial", 1389 | "_N$overflow": 1, 1390 | "_id": "63hGZJRFpMMJ1eQogBVa2u" 1391 | }, 1392 | { 1393 | "__type__": "cc.Sprite", 1394 | "_name": "", 1395 | "_objFlags": 0, 1396 | "node": { 1397 | "__id__": 28 1398 | }, 1399 | "_enabled": true, 1400 | "_srcBlendFactor": 770, 1401 | "_dstBlendFactor": 771, 1402 | "_spriteFrame": { 1403 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1404 | }, 1405 | "_type": 1, 1406 | "_sizeMode": 0, 1407 | "_fillType": 0, 1408 | "_fillCenter": { 1409 | "__type__": "cc.Vec2", 1410 | "x": 0, 1411 | "y": 0 1412 | }, 1413 | "_fillStart": 0, 1414 | "_fillRange": 0, 1415 | "_isTrimmedMode": true, 1416 | "_state": 0, 1417 | "_atlas": null, 1418 | "_id": "a2qsBUpL1PoLIJ6AGbNg4T" 1419 | }, 1420 | { 1421 | "__type__": "cc.Button", 1422 | "_name": "", 1423 | "_objFlags": 0, 1424 | "node": { 1425 | "__id__": 28 1426 | }, 1427 | "_enabled": true, 1428 | "transition": 2, 1429 | "pressedColor": { 1430 | "__type__": "cc.Color", 1431 | "r": 255, 1432 | "g": 255, 1433 | "b": 255, 1434 | "a": 255 1435 | }, 1436 | "hoverColor": { 1437 | "__type__": "cc.Color", 1438 | "r": 255, 1439 | "g": 255, 1440 | "b": 255, 1441 | "a": 255 1442 | }, 1443 | "duration": 0.1, 1444 | "zoomScale": 1.2, 1445 | "clickEvents": [ 1446 | { 1447 | "__id__": 33 1448 | } 1449 | ], 1450 | "_N$interactable": true, 1451 | "_N$enableAutoGrayEffect": false, 1452 | "_N$normalColor": { 1453 | "__type__": "cc.Color", 1454 | "r": 255, 1455 | "g": 255, 1456 | "b": 255, 1457 | "a": 255 1458 | }, 1459 | "_N$disabledColor": { 1460 | "__type__": "cc.Color", 1461 | "r": 255, 1462 | "g": 255, 1463 | "b": 255, 1464 | "a": 255 1465 | }, 1466 | "_N$normalSprite": { 1467 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1468 | }, 1469 | "_N$pressedSprite": { 1470 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1471 | }, 1472 | "pressedSprite": { 1473 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1474 | }, 1475 | "_N$hoverSprite": { 1476 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1477 | }, 1478 | "hoverSprite": { 1479 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1480 | }, 1481 | "_N$disabledSprite": { 1482 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 1483 | }, 1484 | "_N$target": { 1485 | "__id__": 28 1486 | }, 1487 | "_id": "55I5Skn75KmJ4j39odx64Y" 1488 | }, 1489 | { 1490 | "__type__": "cc.ClickEvent", 1491 | "target": { 1492 | "__id__": 2 1493 | }, 1494 | "component": "main", 1495 | "handler": "onClickRain", 1496 | "customEventData": "" 1497 | }, 1498 | { 1499 | "__type__": "cc.Node", 1500 | "_name": "btnWave", 1501 | "_objFlags": 0, 1502 | "_parent": { 1503 | "__id__": 2 1504 | }, 1505 | "_children": [ 1506 | { 1507 | "__id__": 35 1508 | } 1509 | ], 1510 | "_active": true, 1511 | "_level": 2, 1512 | "_components": [ 1513 | { 1514 | "__id__": 37 1515 | }, 1516 | { 1517 | "__id__": 38 1518 | } 1519 | ], 1520 | "_prefab": null, 1521 | "_opacity": 255, 1522 | "_color": { 1523 | "__type__": "cc.Color", 1524 | "r": 255, 1525 | "g": 255, 1526 | "b": 255, 1527 | "a": 255 1528 | }, 1529 | "_contentSize": { 1530 | "__type__": "cc.Size", 1531 | "width": 100, 1532 | "height": 40 1533 | }, 1534 | "_anchorPoint": { 1535 | "__type__": "cc.Vec2", 1536 | "x": 0.5, 1537 | "y": 0.5 1538 | }, 1539 | "_position": { 1540 | "__type__": "cc.Vec3", 1541 | "x": 260, 1542 | "y": -251, 1543 | "z": 0 1544 | }, 1545 | "_scale": { 1546 | "__type__": "cc.Vec3", 1547 | "x": 1, 1548 | "y": 1, 1549 | "z": 1 1550 | }, 1551 | "_rotationX": 0, 1552 | "_rotationY": 0, 1553 | "_quat": { 1554 | "__type__": "cc.Quat", 1555 | "x": 0, 1556 | "y": 0, 1557 | "z": 0, 1558 | "w": 1 1559 | }, 1560 | "_skewX": 0, 1561 | "_skewY": 0, 1562 | "_zIndex": 0, 1563 | "groupIndex": 0, 1564 | "_id": "1e9MkegIpOs6SH3HgK3VMY" 1565 | }, 1566 | { 1567 | "__type__": "cc.Node", 1568 | "_name": "Label", 1569 | "_objFlags": 0, 1570 | "_parent": { 1571 | "__id__": 34 1572 | }, 1573 | "_children": [], 1574 | "_active": true, 1575 | "_level": 0, 1576 | "_components": [ 1577 | { 1578 | "__id__": 36 1579 | } 1580 | ], 1581 | "_prefab": null, 1582 | "_opacity": 255, 1583 | "_color": { 1584 | "__type__": "cc.Color", 1585 | "r": 0, 1586 | "g": 0, 1587 | "b": 0, 1588 | "a": 255 1589 | }, 1590 | "_contentSize": { 1591 | "__type__": "cc.Size", 1592 | "width": 100, 1593 | "height": 40 1594 | }, 1595 | "_anchorPoint": { 1596 | "__type__": "cc.Vec2", 1597 | "x": 0.5, 1598 | "y": 0.5 1599 | }, 1600 | "_position": { 1601 | "__type__": "cc.Vec3", 1602 | "x": 0, 1603 | "y": 0, 1604 | "z": 0 1605 | }, 1606 | "_scale": { 1607 | "__type__": "cc.Vec3", 1608 | "x": 1, 1609 | "y": 1, 1610 | "z": 1 1611 | }, 1612 | "_rotationX": 0, 1613 | "_rotationY": 0, 1614 | "_quat": { 1615 | "__type__": "cc.Quat", 1616 | "x": 0, 1617 | "y": 0, 1618 | "z": 0, 1619 | "w": 1 1620 | }, 1621 | "_skewX": 0, 1622 | "_skewY": 0, 1623 | "_zIndex": 0, 1624 | "groupIndex": 0, 1625 | "_id": "afkl8MYjxFQbiZAAfr9LPk" 1626 | }, 1627 | { 1628 | "__type__": "cc.Label", 1629 | "_name": "", 1630 | "_objFlags": 0, 1631 | "node": { 1632 | "__id__": 35 1633 | }, 1634 | "_enabled": true, 1635 | "_srcBlendFactor": 1, 1636 | "_dstBlendFactor": 771, 1637 | "_useOriginalSize": false, 1638 | "_string": "流动效果", 1639 | "_N$string": "流动效果", 1640 | "_fontSize": 20, 1641 | "_lineHeight": 40, 1642 | "_enableWrapText": false, 1643 | "_N$file": null, 1644 | "_isSystemFontUsed": true, 1645 | "_spacingX": 0, 1646 | "_N$horizontalAlign": 1, 1647 | "_N$verticalAlign": 1, 1648 | "_N$fontFamily": "Arial", 1649 | "_N$overflow": 1, 1650 | "_id": "b2fLdQOhBLlKTsr4WJ/6BR" 1651 | }, 1652 | { 1653 | "__type__": "cc.Sprite", 1654 | "_name": "", 1655 | "_objFlags": 0, 1656 | "node": { 1657 | "__id__": 34 1658 | }, 1659 | "_enabled": true, 1660 | "_srcBlendFactor": 770, 1661 | "_dstBlendFactor": 771, 1662 | "_spriteFrame": { 1663 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1664 | }, 1665 | "_type": 1, 1666 | "_sizeMode": 0, 1667 | "_fillType": 0, 1668 | "_fillCenter": { 1669 | "__type__": "cc.Vec2", 1670 | "x": 0, 1671 | "y": 0 1672 | }, 1673 | "_fillStart": 0, 1674 | "_fillRange": 0, 1675 | "_isTrimmedMode": true, 1676 | "_state": 0, 1677 | "_atlas": null, 1678 | "_id": "17Ylf4GxlD0o+Nf+d/qlad" 1679 | }, 1680 | { 1681 | "__type__": "cc.Button", 1682 | "_name": "", 1683 | "_objFlags": 0, 1684 | "node": { 1685 | "__id__": 34 1686 | }, 1687 | "_enabled": true, 1688 | "transition": 2, 1689 | "pressedColor": { 1690 | "__type__": "cc.Color", 1691 | "r": 255, 1692 | "g": 255, 1693 | "b": 255, 1694 | "a": 255 1695 | }, 1696 | "hoverColor": { 1697 | "__type__": "cc.Color", 1698 | "r": 255, 1699 | "g": 255, 1700 | "b": 255, 1701 | "a": 255 1702 | }, 1703 | "duration": 0.1, 1704 | "zoomScale": 1.2, 1705 | "clickEvents": [ 1706 | { 1707 | "__id__": 39 1708 | } 1709 | ], 1710 | "_N$interactable": true, 1711 | "_N$enableAutoGrayEffect": false, 1712 | "_N$normalColor": { 1713 | "__type__": "cc.Color", 1714 | "r": 255, 1715 | "g": 255, 1716 | "b": 255, 1717 | "a": 255 1718 | }, 1719 | "_N$disabledColor": { 1720 | "__type__": "cc.Color", 1721 | "r": 255, 1722 | "g": 255, 1723 | "b": 255, 1724 | "a": 255 1725 | }, 1726 | "_N$normalSprite": { 1727 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1728 | }, 1729 | "_N$pressedSprite": { 1730 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1731 | }, 1732 | "pressedSprite": { 1733 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1734 | }, 1735 | "_N$hoverSprite": { 1736 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1737 | }, 1738 | "hoverSprite": { 1739 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1740 | }, 1741 | "_N$disabledSprite": { 1742 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 1743 | }, 1744 | "_N$target": { 1745 | "__id__": 34 1746 | }, 1747 | "_id": "14xHZx5+BG3KBfzZHeCUlL" 1748 | }, 1749 | { 1750 | "__type__": "cc.ClickEvent", 1751 | "target": { 1752 | "__id__": 2 1753 | }, 1754 | "component": "main", 1755 | "handler": "onClickWave", 1756 | "customEventData": "" 1757 | }, 1758 | { 1759 | "__type__": "cc.Node", 1760 | "_name": "btnBlurs", 1761 | "_objFlags": 0, 1762 | "_parent": { 1763 | "__id__": 2 1764 | }, 1765 | "_children": [ 1766 | { 1767 | "__id__": 41 1768 | } 1769 | ], 1770 | "_active": true, 1771 | "_level": 2, 1772 | "_components": [ 1773 | { 1774 | "__id__": 43 1775 | }, 1776 | { 1777 | "__id__": 44 1778 | } 1779 | ], 1780 | "_prefab": null, 1781 | "_opacity": 255, 1782 | "_color": { 1783 | "__type__": "cc.Color", 1784 | "r": 255, 1785 | "g": 255, 1786 | "b": 255, 1787 | "a": 255 1788 | }, 1789 | "_contentSize": { 1790 | "__type__": "cc.Size", 1791 | "width": 100, 1792 | "height": 40 1793 | }, 1794 | "_anchorPoint": { 1795 | "__type__": "cc.Vec2", 1796 | "x": 0.5, 1797 | "y": 0.5 1798 | }, 1799 | "_position": { 1800 | "__type__": "cc.Vec3", 1801 | "x": 396, 1802 | "y": -252, 1803 | "z": 0 1804 | }, 1805 | "_scale": { 1806 | "__type__": "cc.Vec3", 1807 | "x": 1, 1808 | "y": 1, 1809 | "z": 1 1810 | }, 1811 | "_rotationX": 0, 1812 | "_rotationY": 0, 1813 | "_quat": { 1814 | "__type__": "cc.Quat", 1815 | "x": 0, 1816 | "y": 0, 1817 | "z": 0, 1818 | "w": 1 1819 | }, 1820 | "_skewX": 0, 1821 | "_skewY": 0, 1822 | "_zIndex": 0, 1823 | "groupIndex": 0, 1824 | "_id": "efVZwQaJlGhocyHq2nECzu" 1825 | }, 1826 | { 1827 | "__type__": "cc.Node", 1828 | "_name": "Label", 1829 | "_objFlags": 0, 1830 | "_parent": { 1831 | "__id__": 40 1832 | }, 1833 | "_children": [], 1834 | "_active": true, 1835 | "_level": 0, 1836 | "_components": [ 1837 | { 1838 | "__id__": 42 1839 | } 1840 | ], 1841 | "_prefab": null, 1842 | "_opacity": 255, 1843 | "_color": { 1844 | "__type__": "cc.Color", 1845 | "r": 0, 1846 | "g": 0, 1847 | "b": 0, 1848 | "a": 255 1849 | }, 1850 | "_contentSize": { 1851 | "__type__": "cc.Size", 1852 | "width": 100, 1853 | "height": 40 1854 | }, 1855 | "_anchorPoint": { 1856 | "__type__": "cc.Vec2", 1857 | "x": 0.5, 1858 | "y": 0.5 1859 | }, 1860 | "_position": { 1861 | "__type__": "cc.Vec3", 1862 | "x": 0, 1863 | "y": 0, 1864 | "z": 0 1865 | }, 1866 | "_scale": { 1867 | "__type__": "cc.Vec3", 1868 | "x": 1, 1869 | "y": 1, 1870 | "z": 1 1871 | }, 1872 | "_rotationX": 0, 1873 | "_rotationY": 0, 1874 | "_quat": { 1875 | "__type__": "cc.Quat", 1876 | "x": 0, 1877 | "y": 0, 1878 | "z": 0, 1879 | "w": 1 1880 | }, 1881 | "_skewX": 0, 1882 | "_skewY": 0, 1883 | "_zIndex": 0, 1884 | "groupIndex": 0, 1885 | "_id": "df4NtTZxhGiJ44fpsQ9GEX" 1886 | }, 1887 | { 1888 | "__type__": "cc.Label", 1889 | "_name": "", 1890 | "_objFlags": 0, 1891 | "node": { 1892 | "__id__": 41 1893 | }, 1894 | "_enabled": true, 1895 | "_srcBlendFactor": 1, 1896 | "_dstBlendFactor": 771, 1897 | "_useOriginalSize": false, 1898 | "_string": "高斯模糊", 1899 | "_N$string": "高斯模糊", 1900 | "_fontSize": 20, 1901 | "_lineHeight": 40, 1902 | "_enableWrapText": false, 1903 | "_N$file": null, 1904 | "_isSystemFontUsed": true, 1905 | "_spacingX": 0, 1906 | "_N$horizontalAlign": 1, 1907 | "_N$verticalAlign": 1, 1908 | "_N$fontFamily": "Arial", 1909 | "_N$overflow": 1, 1910 | "_id": "728B/oNPVC1K+i8Tixi4Ye" 1911 | }, 1912 | { 1913 | "__type__": "cc.Sprite", 1914 | "_name": "", 1915 | "_objFlags": 0, 1916 | "node": { 1917 | "__id__": 40 1918 | }, 1919 | "_enabled": true, 1920 | "_srcBlendFactor": 770, 1921 | "_dstBlendFactor": 771, 1922 | "_spriteFrame": { 1923 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1924 | }, 1925 | "_type": 1, 1926 | "_sizeMode": 0, 1927 | "_fillType": 0, 1928 | "_fillCenter": { 1929 | "__type__": "cc.Vec2", 1930 | "x": 0, 1931 | "y": 0 1932 | }, 1933 | "_fillStart": 0, 1934 | "_fillRange": 0, 1935 | "_isTrimmedMode": true, 1936 | "_state": 0, 1937 | "_atlas": null, 1938 | "_id": "803l81urpCqIcTTPAm0IQC" 1939 | }, 1940 | { 1941 | "__type__": "cc.Button", 1942 | "_name": "", 1943 | "_objFlags": 0, 1944 | "node": { 1945 | "__id__": 40 1946 | }, 1947 | "_enabled": true, 1948 | "transition": 2, 1949 | "pressedColor": { 1950 | "__type__": "cc.Color", 1951 | "r": 255, 1952 | "g": 255, 1953 | "b": 255, 1954 | "a": 255 1955 | }, 1956 | "hoverColor": { 1957 | "__type__": "cc.Color", 1958 | "r": 255, 1959 | "g": 255, 1960 | "b": 255, 1961 | "a": 255 1962 | }, 1963 | "duration": 0.1, 1964 | "zoomScale": 1.2, 1965 | "clickEvents": [ 1966 | { 1967 | "__id__": 45 1968 | } 1969 | ], 1970 | "_N$interactable": true, 1971 | "_N$enableAutoGrayEffect": false, 1972 | "_N$normalColor": { 1973 | "__type__": "cc.Color", 1974 | "r": 255, 1975 | "g": 255, 1976 | "b": 255, 1977 | "a": 255 1978 | }, 1979 | "_N$disabledColor": { 1980 | "__type__": "cc.Color", 1981 | "r": 255, 1982 | "g": 255, 1983 | "b": 255, 1984 | "a": 255 1985 | }, 1986 | "_N$normalSprite": { 1987 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1988 | }, 1989 | "_N$pressedSprite": { 1990 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1991 | }, 1992 | "pressedSprite": { 1993 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 1994 | }, 1995 | "_N$hoverSprite": { 1996 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 1997 | }, 1998 | "hoverSprite": { 1999 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2000 | }, 2001 | "_N$disabledSprite": { 2002 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 2003 | }, 2004 | "_N$target": { 2005 | "__id__": 40 2006 | }, 2007 | "_id": "84IXxb2EVN4bUHp8ebuIWx" 2008 | }, 2009 | { 2010 | "__type__": "cc.ClickEvent", 2011 | "target": { 2012 | "__id__": 2 2013 | }, 2014 | "component": "main", 2015 | "handler": "onClickBlurs", 2016 | "customEventData": "" 2017 | }, 2018 | { 2019 | "__type__": "cc.Node", 2020 | "_name": "btnOutline", 2021 | "_objFlags": 0, 2022 | "_parent": { 2023 | "__id__": 2 2024 | }, 2025 | "_children": [ 2026 | { 2027 | "__id__": 47 2028 | } 2029 | ], 2030 | "_active": true, 2031 | "_level": 2, 2032 | "_components": [ 2033 | { 2034 | "__id__": 49 2035 | }, 2036 | { 2037 | "__id__": 50 2038 | } 2039 | ], 2040 | "_prefab": null, 2041 | "_opacity": 255, 2042 | "_color": { 2043 | "__type__": "cc.Color", 2044 | "r": 255, 2045 | "g": 255, 2046 | "b": 255, 2047 | "a": 255 2048 | }, 2049 | "_contentSize": { 2050 | "__type__": "cc.Size", 2051 | "width": 100, 2052 | "height": 40 2053 | }, 2054 | "_anchorPoint": { 2055 | "__type__": "cc.Vec2", 2056 | "x": 0.5, 2057 | "y": 0.5 2058 | }, 2059 | "_position": { 2060 | "__type__": "cc.Vec3", 2061 | "x": -289, 2062 | "y": -317, 2063 | "z": 0 2064 | }, 2065 | "_scale": { 2066 | "__type__": "cc.Vec3", 2067 | "x": 1, 2068 | "y": 1, 2069 | "z": 1 2070 | }, 2071 | "_rotationX": 0, 2072 | "_rotationY": 0, 2073 | "_quat": { 2074 | "__type__": "cc.Quat", 2075 | "x": 0, 2076 | "y": 0, 2077 | "z": 0, 2078 | "w": 1 2079 | }, 2080 | "_skewX": 0, 2081 | "_skewY": 0, 2082 | "_zIndex": 0, 2083 | "groupIndex": 0, 2084 | "_id": "2d7FrvksZJgZJ4la+rQlIs" 2085 | }, 2086 | { 2087 | "__type__": "cc.Node", 2088 | "_name": "Label", 2089 | "_objFlags": 0, 2090 | "_parent": { 2091 | "__id__": 46 2092 | }, 2093 | "_children": [], 2094 | "_active": true, 2095 | "_level": 0, 2096 | "_components": [ 2097 | { 2098 | "__id__": 48 2099 | } 2100 | ], 2101 | "_prefab": null, 2102 | "_opacity": 255, 2103 | "_color": { 2104 | "__type__": "cc.Color", 2105 | "r": 0, 2106 | "g": 0, 2107 | "b": 0, 2108 | "a": 255 2109 | }, 2110 | "_contentSize": { 2111 | "__type__": "cc.Size", 2112 | "width": 100, 2113 | "height": 40 2114 | }, 2115 | "_anchorPoint": { 2116 | "__type__": "cc.Vec2", 2117 | "x": 0.5, 2118 | "y": 0.5 2119 | }, 2120 | "_position": { 2121 | "__type__": "cc.Vec3", 2122 | "x": 0, 2123 | "y": 0, 2124 | "z": 0 2125 | }, 2126 | "_scale": { 2127 | "__type__": "cc.Vec3", 2128 | "x": 1, 2129 | "y": 1, 2130 | "z": 1 2131 | }, 2132 | "_rotationX": 0, 2133 | "_rotationY": 0, 2134 | "_quat": { 2135 | "__type__": "cc.Quat", 2136 | "x": 0, 2137 | "y": 0, 2138 | "z": 0, 2139 | "w": 1 2140 | }, 2141 | "_skewX": 0, 2142 | "_skewY": 0, 2143 | "_zIndex": 0, 2144 | "groupIndex": 0, 2145 | "_id": "fdyYJ6zUBGtomq9H8QnwsM" 2146 | }, 2147 | { 2148 | "__type__": "cc.Label", 2149 | "_name": "", 2150 | "_objFlags": 0, 2151 | "node": { 2152 | "__id__": 47 2153 | }, 2154 | "_enabled": true, 2155 | "_srcBlendFactor": 1, 2156 | "_dstBlendFactor": 771, 2157 | "_useOriginalSize": false, 2158 | "_string": "描边", 2159 | "_N$string": "描边", 2160 | "_fontSize": 20, 2161 | "_lineHeight": 40, 2162 | "_enableWrapText": false, 2163 | "_N$file": null, 2164 | "_isSystemFontUsed": true, 2165 | "_spacingX": 0, 2166 | "_N$horizontalAlign": 1, 2167 | "_N$verticalAlign": 1, 2168 | "_N$fontFamily": "Arial", 2169 | "_N$overflow": 1, 2170 | "_id": "d7xyRDzgpLOJIrU+42sAQ3" 2171 | }, 2172 | { 2173 | "__type__": "cc.Sprite", 2174 | "_name": "", 2175 | "_objFlags": 0, 2176 | "node": { 2177 | "__id__": 46 2178 | }, 2179 | "_enabled": true, 2180 | "_srcBlendFactor": 770, 2181 | "_dstBlendFactor": 771, 2182 | "_spriteFrame": { 2183 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2184 | }, 2185 | "_type": 1, 2186 | "_sizeMode": 0, 2187 | "_fillType": 0, 2188 | "_fillCenter": { 2189 | "__type__": "cc.Vec2", 2190 | "x": 0, 2191 | "y": 0 2192 | }, 2193 | "_fillStart": 0, 2194 | "_fillRange": 0, 2195 | "_isTrimmedMode": true, 2196 | "_state": 0, 2197 | "_atlas": null, 2198 | "_id": "ecaLYY8BJIkaSzKvgTKEaw" 2199 | }, 2200 | { 2201 | "__type__": "cc.Button", 2202 | "_name": "", 2203 | "_objFlags": 0, 2204 | "node": { 2205 | "__id__": 46 2206 | }, 2207 | "_enabled": true, 2208 | "transition": 2, 2209 | "pressedColor": { 2210 | "__type__": "cc.Color", 2211 | "r": 255, 2212 | "g": 255, 2213 | "b": 255, 2214 | "a": 255 2215 | }, 2216 | "hoverColor": { 2217 | "__type__": "cc.Color", 2218 | "r": 255, 2219 | "g": 255, 2220 | "b": 255, 2221 | "a": 255 2222 | }, 2223 | "duration": 0.1, 2224 | "zoomScale": 1.2, 2225 | "clickEvents": [ 2226 | { 2227 | "__id__": 51 2228 | } 2229 | ], 2230 | "_N$interactable": true, 2231 | "_N$enableAutoGrayEffect": false, 2232 | "_N$normalColor": { 2233 | "__type__": "cc.Color", 2234 | "r": 255, 2235 | "g": 255, 2236 | "b": 255, 2237 | "a": 255 2238 | }, 2239 | "_N$disabledColor": { 2240 | "__type__": "cc.Color", 2241 | "r": 255, 2242 | "g": 255, 2243 | "b": 255, 2244 | "a": 255 2245 | }, 2246 | "_N$normalSprite": { 2247 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2248 | }, 2249 | "_N$pressedSprite": { 2250 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 2251 | }, 2252 | "pressedSprite": { 2253 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 2254 | }, 2255 | "_N$hoverSprite": { 2256 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2257 | }, 2258 | "hoverSprite": { 2259 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2260 | }, 2261 | "_N$disabledSprite": { 2262 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 2263 | }, 2264 | "_N$target": { 2265 | "__id__": 46 2266 | }, 2267 | "_id": "fdtI9rxylDlZYLU1TmdZWn" 2268 | }, 2269 | { 2270 | "__type__": "cc.ClickEvent", 2271 | "target": { 2272 | "__id__": 2 2273 | }, 2274 | "component": "main", 2275 | "handler": "onClickOutline", 2276 | "customEventData": "" 2277 | }, 2278 | { 2279 | "__type__": "cc.Node", 2280 | "_name": "btnGrowing", 2281 | "_objFlags": 0, 2282 | "_parent": { 2283 | "__id__": 2 2284 | }, 2285 | "_children": [ 2286 | { 2287 | "__id__": 53 2288 | } 2289 | ], 2290 | "_active": true, 2291 | "_level": 2, 2292 | "_components": [ 2293 | { 2294 | "__id__": 55 2295 | }, 2296 | { 2297 | "__id__": 56 2298 | } 2299 | ], 2300 | "_prefab": null, 2301 | "_opacity": 255, 2302 | "_color": { 2303 | "__type__": "cc.Color", 2304 | "r": 255, 2305 | "g": 255, 2306 | "b": 255, 2307 | "a": 255 2308 | }, 2309 | "_contentSize": { 2310 | "__type__": "cc.Size", 2311 | "width": 100, 2312 | "height": 40 2313 | }, 2314 | "_anchorPoint": { 2315 | "__type__": "cc.Vec2", 2316 | "x": 0.5, 2317 | "y": 0.5 2318 | }, 2319 | "_position": { 2320 | "__type__": "cc.Vec3", 2321 | "x": -154, 2322 | "y": -318, 2323 | "z": 0 2324 | }, 2325 | "_scale": { 2326 | "__type__": "cc.Vec3", 2327 | "x": 1, 2328 | "y": 1, 2329 | "z": 1 2330 | }, 2331 | "_rotationX": 0, 2332 | "_rotationY": 0, 2333 | "_quat": { 2334 | "__type__": "cc.Quat", 2335 | "x": 0, 2336 | "y": 0, 2337 | "z": 0, 2338 | "w": 1 2339 | }, 2340 | "_skewX": 0, 2341 | "_skewY": 0, 2342 | "_zIndex": 0, 2343 | "groupIndex": 0, 2344 | "_id": "f2bj3d4k5JcrYEIlOJr1kF" 2345 | }, 2346 | { 2347 | "__type__": "cc.Node", 2348 | "_name": "Label", 2349 | "_objFlags": 0, 2350 | "_parent": { 2351 | "__id__": 52 2352 | }, 2353 | "_children": [], 2354 | "_active": true, 2355 | "_level": 0, 2356 | "_components": [ 2357 | { 2358 | "__id__": 54 2359 | } 2360 | ], 2361 | "_prefab": null, 2362 | "_opacity": 255, 2363 | "_color": { 2364 | "__type__": "cc.Color", 2365 | "r": 0, 2366 | "g": 0, 2367 | "b": 0, 2368 | "a": 255 2369 | }, 2370 | "_contentSize": { 2371 | "__type__": "cc.Size", 2372 | "width": 100, 2373 | "height": 40 2374 | }, 2375 | "_anchorPoint": { 2376 | "__type__": "cc.Vec2", 2377 | "x": 0.5, 2378 | "y": 0.5 2379 | }, 2380 | "_position": { 2381 | "__type__": "cc.Vec3", 2382 | "x": 0, 2383 | "y": 0, 2384 | "z": 0 2385 | }, 2386 | "_scale": { 2387 | "__type__": "cc.Vec3", 2388 | "x": 1, 2389 | "y": 1, 2390 | "z": 1 2391 | }, 2392 | "_rotationX": 0, 2393 | "_rotationY": 0, 2394 | "_quat": { 2395 | "__type__": "cc.Quat", 2396 | "x": 0, 2397 | "y": 0, 2398 | "z": 0, 2399 | "w": 1 2400 | }, 2401 | "_skewX": 0, 2402 | "_skewY": 0, 2403 | "_zIndex": 0, 2404 | "groupIndex": 0, 2405 | "_id": "ebHTFg21NOiJOB6ae57Dl/" 2406 | }, 2407 | { 2408 | "__type__": "cc.Label", 2409 | "_name": "", 2410 | "_objFlags": 0, 2411 | "node": { 2412 | "__id__": 53 2413 | }, 2414 | "_enabled": true, 2415 | "_srcBlendFactor": 1, 2416 | "_dstBlendFactor": 771, 2417 | "_useOriginalSize": false, 2418 | "_string": "外发光", 2419 | "_N$string": "外发光", 2420 | "_fontSize": 20, 2421 | "_lineHeight": 40, 2422 | "_enableWrapText": false, 2423 | "_N$file": null, 2424 | "_isSystemFontUsed": true, 2425 | "_spacingX": 0, 2426 | "_N$horizontalAlign": 1, 2427 | "_N$verticalAlign": 1, 2428 | "_N$fontFamily": "Arial", 2429 | "_N$overflow": 1, 2430 | "_id": "38kEFygwZJO5Opi8hPU6zn" 2431 | }, 2432 | { 2433 | "__type__": "cc.Sprite", 2434 | "_name": "", 2435 | "_objFlags": 0, 2436 | "node": { 2437 | "__id__": 52 2438 | }, 2439 | "_enabled": true, 2440 | "_srcBlendFactor": 770, 2441 | "_dstBlendFactor": 771, 2442 | "_spriteFrame": { 2443 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2444 | }, 2445 | "_type": 1, 2446 | "_sizeMode": 0, 2447 | "_fillType": 0, 2448 | "_fillCenter": { 2449 | "__type__": "cc.Vec2", 2450 | "x": 0, 2451 | "y": 0 2452 | }, 2453 | "_fillStart": 0, 2454 | "_fillRange": 0, 2455 | "_isTrimmedMode": true, 2456 | "_state": 0, 2457 | "_atlas": null, 2458 | "_id": "81B0zN6j1C9IKYAZBpPYik" 2459 | }, 2460 | { 2461 | "__type__": "cc.Button", 2462 | "_name": "", 2463 | "_objFlags": 0, 2464 | "node": { 2465 | "__id__": 52 2466 | }, 2467 | "_enabled": true, 2468 | "transition": 2, 2469 | "pressedColor": { 2470 | "__type__": "cc.Color", 2471 | "r": 255, 2472 | "g": 255, 2473 | "b": 255, 2474 | "a": 255 2475 | }, 2476 | "hoverColor": { 2477 | "__type__": "cc.Color", 2478 | "r": 255, 2479 | "g": 255, 2480 | "b": 255, 2481 | "a": 255 2482 | }, 2483 | "duration": 0.1, 2484 | "zoomScale": 1.2, 2485 | "clickEvents": [ 2486 | { 2487 | "__id__": 57 2488 | } 2489 | ], 2490 | "_N$interactable": true, 2491 | "_N$enableAutoGrayEffect": false, 2492 | "_N$normalColor": { 2493 | "__type__": "cc.Color", 2494 | "r": 255, 2495 | "g": 255, 2496 | "b": 255, 2497 | "a": 255 2498 | }, 2499 | "_N$disabledColor": { 2500 | "__type__": "cc.Color", 2501 | "r": 255, 2502 | "g": 255, 2503 | "b": 255, 2504 | "a": 255 2505 | }, 2506 | "_N$normalSprite": { 2507 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2508 | }, 2509 | "_N$pressedSprite": { 2510 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 2511 | }, 2512 | "pressedSprite": { 2513 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 2514 | }, 2515 | "_N$hoverSprite": { 2516 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2517 | }, 2518 | "hoverSprite": { 2519 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2520 | }, 2521 | "_N$disabledSprite": { 2522 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 2523 | }, 2524 | "_N$target": { 2525 | "__id__": 52 2526 | }, 2527 | "_id": "725ZGsd2hI3pBLEVroZdnU" 2528 | }, 2529 | { 2530 | "__type__": "cc.ClickEvent", 2531 | "target": { 2532 | "__id__": 2 2533 | }, 2534 | "component": "main", 2535 | "handler": "onClickGrowing", 2536 | "customEventData": "" 2537 | }, 2538 | { 2539 | "__type__": "cc.Node", 2540 | "_name": "btnWater", 2541 | "_objFlags": 0, 2542 | "_parent": { 2543 | "__id__": 2 2544 | }, 2545 | "_children": [ 2546 | { 2547 | "__id__": 59 2548 | } 2549 | ], 2550 | "_active": true, 2551 | "_level": 2, 2552 | "_components": [ 2553 | { 2554 | "__id__": 61 2555 | }, 2556 | { 2557 | "__id__": 62 2558 | } 2559 | ], 2560 | "_prefab": null, 2561 | "_opacity": 255, 2562 | "_color": { 2563 | "__type__": "cc.Color", 2564 | "r": 255, 2565 | "g": 255, 2566 | "b": 255, 2567 | "a": 255 2568 | }, 2569 | "_contentSize": { 2570 | "__type__": "cc.Size", 2571 | "width": 100, 2572 | "height": 40 2573 | }, 2574 | "_anchorPoint": { 2575 | "__type__": "cc.Vec2", 2576 | "x": 0.5, 2577 | "y": 0.5 2578 | }, 2579 | "_position": { 2580 | "__type__": "cc.Vec3", 2581 | "x": -16, 2582 | "y": -317, 2583 | "z": 0 2584 | }, 2585 | "_scale": { 2586 | "__type__": "cc.Vec3", 2587 | "x": 1, 2588 | "y": 1, 2589 | "z": 1 2590 | }, 2591 | "_rotationX": 0, 2592 | "_rotationY": 0, 2593 | "_quat": { 2594 | "__type__": "cc.Quat", 2595 | "x": 0, 2596 | "y": 0, 2597 | "z": 0, 2598 | "w": 1 2599 | }, 2600 | "_skewX": 0, 2601 | "_skewY": 0, 2602 | "_zIndex": 0, 2603 | "groupIndex": 0, 2604 | "_id": "94ueHd9ydMuYtAzb9biY31" 2605 | }, 2606 | { 2607 | "__type__": "cc.Node", 2608 | "_name": "Label", 2609 | "_objFlags": 0, 2610 | "_parent": { 2611 | "__id__": 58 2612 | }, 2613 | "_children": [], 2614 | "_active": true, 2615 | "_level": 0, 2616 | "_components": [ 2617 | { 2618 | "__id__": 60 2619 | } 2620 | ], 2621 | "_prefab": null, 2622 | "_opacity": 255, 2623 | "_color": { 2624 | "__type__": "cc.Color", 2625 | "r": 0, 2626 | "g": 0, 2627 | "b": 0, 2628 | "a": 255 2629 | }, 2630 | "_contentSize": { 2631 | "__type__": "cc.Size", 2632 | "width": 100, 2633 | "height": 40 2634 | }, 2635 | "_anchorPoint": { 2636 | "__type__": "cc.Vec2", 2637 | "x": 0.5, 2638 | "y": 0.5 2639 | }, 2640 | "_position": { 2641 | "__type__": "cc.Vec3", 2642 | "x": 0, 2643 | "y": 0, 2644 | "z": 0 2645 | }, 2646 | "_scale": { 2647 | "__type__": "cc.Vec3", 2648 | "x": 1, 2649 | "y": 1, 2650 | "z": 1 2651 | }, 2652 | "_rotationX": 0, 2653 | "_rotationY": 0, 2654 | "_quat": { 2655 | "__type__": "cc.Quat", 2656 | "x": 0, 2657 | "y": 0, 2658 | "z": 0, 2659 | "w": 1 2660 | }, 2661 | "_skewX": 0, 2662 | "_skewY": 0, 2663 | "_zIndex": 0, 2664 | "groupIndex": 0, 2665 | "_id": "02k/6wMORKpJy0aq16GfxQ" 2666 | }, 2667 | { 2668 | "__type__": "cc.Label", 2669 | "_name": "", 2670 | "_objFlags": 0, 2671 | "node": { 2672 | "__id__": 59 2673 | }, 2674 | "_enabled": true, 2675 | "_srcBlendFactor": 1, 2676 | "_dstBlendFactor": 771, 2677 | "_useOriginalSize": false, 2678 | "_string": "水", 2679 | "_N$string": "水", 2680 | "_fontSize": 20, 2681 | "_lineHeight": 40, 2682 | "_enableWrapText": false, 2683 | "_N$file": null, 2684 | "_isSystemFontUsed": true, 2685 | "_spacingX": 0, 2686 | "_N$horizontalAlign": 1, 2687 | "_N$verticalAlign": 1, 2688 | "_N$fontFamily": "Arial", 2689 | "_N$overflow": 1, 2690 | "_id": "9bw7OXHo1P9qpvQGcueH56" 2691 | }, 2692 | { 2693 | "__type__": "cc.Sprite", 2694 | "_name": "", 2695 | "_objFlags": 0, 2696 | "node": { 2697 | "__id__": 58 2698 | }, 2699 | "_enabled": true, 2700 | "_srcBlendFactor": 770, 2701 | "_dstBlendFactor": 771, 2702 | "_spriteFrame": { 2703 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2704 | }, 2705 | "_type": 1, 2706 | "_sizeMode": 0, 2707 | "_fillType": 0, 2708 | "_fillCenter": { 2709 | "__type__": "cc.Vec2", 2710 | "x": 0, 2711 | "y": 0 2712 | }, 2713 | "_fillStart": 0, 2714 | "_fillRange": 0, 2715 | "_isTrimmedMode": true, 2716 | "_state": 0, 2717 | "_atlas": null, 2718 | "_id": "e2VJBmqFtE7qBKQNDCJXJt" 2719 | }, 2720 | { 2721 | "__type__": "cc.Button", 2722 | "_name": "", 2723 | "_objFlags": 0, 2724 | "node": { 2725 | "__id__": 58 2726 | }, 2727 | "_enabled": true, 2728 | "transition": 2, 2729 | "pressedColor": { 2730 | "__type__": "cc.Color", 2731 | "r": 255, 2732 | "g": 255, 2733 | "b": 255, 2734 | "a": 255 2735 | }, 2736 | "hoverColor": { 2737 | "__type__": "cc.Color", 2738 | "r": 255, 2739 | "g": 255, 2740 | "b": 255, 2741 | "a": 255 2742 | }, 2743 | "duration": 0.1, 2744 | "zoomScale": 1.2, 2745 | "clickEvents": [ 2746 | { 2747 | "__id__": 63 2748 | } 2749 | ], 2750 | "_N$interactable": true, 2751 | "_N$enableAutoGrayEffect": false, 2752 | "_N$normalColor": { 2753 | "__type__": "cc.Color", 2754 | "r": 255, 2755 | "g": 255, 2756 | "b": 255, 2757 | "a": 255 2758 | }, 2759 | "_N$disabledColor": { 2760 | "__type__": "cc.Color", 2761 | "r": 255, 2762 | "g": 255, 2763 | "b": 255, 2764 | "a": 255 2765 | }, 2766 | "_N$normalSprite": { 2767 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2768 | }, 2769 | "_N$pressedSprite": { 2770 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 2771 | }, 2772 | "pressedSprite": { 2773 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 2774 | }, 2775 | "_N$hoverSprite": { 2776 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2777 | }, 2778 | "hoverSprite": { 2779 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2780 | }, 2781 | "_N$disabledSprite": { 2782 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 2783 | }, 2784 | "_N$target": { 2785 | "__id__": 58 2786 | }, 2787 | "_id": "05sf+WjJFM2JWwACzTCtwU" 2788 | }, 2789 | { 2790 | "__type__": "cc.ClickEvent", 2791 | "target": { 2792 | "__id__": 2 2793 | }, 2794 | "component": "main", 2795 | "handler": "onClickWater", 2796 | "customEventData": "" 2797 | }, 2798 | { 2799 | "__type__": "cc.Node", 2800 | "_name": "btnMosaic", 2801 | "_objFlags": 0, 2802 | "_parent": { 2803 | "__id__": 2 2804 | }, 2805 | "_children": [ 2806 | { 2807 | "__id__": 65 2808 | } 2809 | ], 2810 | "_active": true, 2811 | "_level": 2, 2812 | "_components": [ 2813 | { 2814 | "__id__": 67 2815 | }, 2816 | { 2817 | "__id__": 68 2818 | } 2819 | ], 2820 | "_prefab": null, 2821 | "_opacity": 255, 2822 | "_color": { 2823 | "__type__": "cc.Color", 2824 | "r": 255, 2825 | "g": 255, 2826 | "b": 255, 2827 | "a": 255 2828 | }, 2829 | "_contentSize": { 2830 | "__type__": "cc.Size", 2831 | "width": 100, 2832 | "height": 40 2833 | }, 2834 | "_anchorPoint": { 2835 | "__type__": "cc.Vec2", 2836 | "x": 0.5, 2837 | "y": 0.5 2838 | }, 2839 | "_position": { 2840 | "__type__": "cc.Vec3", 2841 | "x": 118, 2842 | "y": -317, 2843 | "z": 0 2844 | }, 2845 | "_scale": { 2846 | "__type__": "cc.Vec3", 2847 | "x": 1, 2848 | "y": 1, 2849 | "z": 1 2850 | }, 2851 | "_rotationX": 0, 2852 | "_rotationY": 0, 2853 | "_quat": { 2854 | "__type__": "cc.Quat", 2855 | "x": 0, 2856 | "y": 0, 2857 | "z": 0, 2858 | "w": 1 2859 | }, 2860 | "_skewX": 0, 2861 | "_skewY": 0, 2862 | "_zIndex": 0, 2863 | "groupIndex": 0, 2864 | "_id": "fcqfvc8KpIL7/ISY2HHsJM" 2865 | }, 2866 | { 2867 | "__type__": "cc.Node", 2868 | "_name": "Label", 2869 | "_objFlags": 0, 2870 | "_parent": { 2871 | "__id__": 64 2872 | }, 2873 | "_children": [], 2874 | "_active": true, 2875 | "_level": 0, 2876 | "_components": [ 2877 | { 2878 | "__id__": 66 2879 | } 2880 | ], 2881 | "_prefab": null, 2882 | "_opacity": 255, 2883 | "_color": { 2884 | "__type__": "cc.Color", 2885 | "r": 0, 2886 | "g": 0, 2887 | "b": 0, 2888 | "a": 255 2889 | }, 2890 | "_contentSize": { 2891 | "__type__": "cc.Size", 2892 | "width": 100, 2893 | "height": 40 2894 | }, 2895 | "_anchorPoint": { 2896 | "__type__": "cc.Vec2", 2897 | "x": 0.5, 2898 | "y": 0.5 2899 | }, 2900 | "_position": { 2901 | "__type__": "cc.Vec3", 2902 | "x": 0, 2903 | "y": 0, 2904 | "z": 0 2905 | }, 2906 | "_scale": { 2907 | "__type__": "cc.Vec3", 2908 | "x": 1, 2909 | "y": 1, 2910 | "z": 1 2911 | }, 2912 | "_rotationX": 0, 2913 | "_rotationY": 0, 2914 | "_quat": { 2915 | "__type__": "cc.Quat", 2916 | "x": 0, 2917 | "y": 0, 2918 | "z": 0, 2919 | "w": 1 2920 | }, 2921 | "_skewX": 0, 2922 | "_skewY": 0, 2923 | "_zIndex": 0, 2924 | "groupIndex": 0, 2925 | "_id": "e4crIxdHFEIKeiMUsRwRNA" 2926 | }, 2927 | { 2928 | "__type__": "cc.Label", 2929 | "_name": "", 2930 | "_objFlags": 0, 2931 | "node": { 2932 | "__id__": 65 2933 | }, 2934 | "_enabled": true, 2935 | "_srcBlendFactor": 1, 2936 | "_dstBlendFactor": 771, 2937 | "_useOriginalSize": false, 2938 | "_string": "马赛克", 2939 | "_N$string": "马赛克", 2940 | "_fontSize": 20, 2941 | "_lineHeight": 40, 2942 | "_enableWrapText": false, 2943 | "_N$file": null, 2944 | "_isSystemFontUsed": true, 2945 | "_spacingX": 0, 2946 | "_N$horizontalAlign": 1, 2947 | "_N$verticalAlign": 1, 2948 | "_N$fontFamily": "Arial", 2949 | "_N$overflow": 1, 2950 | "_id": "cbV4m2ujFAJoGS6zPjROCg" 2951 | }, 2952 | { 2953 | "__type__": "cc.Sprite", 2954 | "_name": "", 2955 | "_objFlags": 0, 2956 | "node": { 2957 | "__id__": 64 2958 | }, 2959 | "_enabled": true, 2960 | "_srcBlendFactor": 770, 2961 | "_dstBlendFactor": 771, 2962 | "_spriteFrame": { 2963 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 2964 | }, 2965 | "_type": 1, 2966 | "_sizeMode": 0, 2967 | "_fillType": 0, 2968 | "_fillCenter": { 2969 | "__type__": "cc.Vec2", 2970 | "x": 0, 2971 | "y": 0 2972 | }, 2973 | "_fillStart": 0, 2974 | "_fillRange": 0, 2975 | "_isTrimmedMode": true, 2976 | "_state": 0, 2977 | "_atlas": null, 2978 | "_id": "605f8OVpZJYofxrCAvUFGz" 2979 | }, 2980 | { 2981 | "__type__": "cc.Button", 2982 | "_name": "", 2983 | "_objFlags": 0, 2984 | "node": { 2985 | "__id__": 64 2986 | }, 2987 | "_enabled": true, 2988 | "transition": 2, 2989 | "pressedColor": { 2990 | "__type__": "cc.Color", 2991 | "r": 255, 2992 | "g": 255, 2993 | "b": 255, 2994 | "a": 255 2995 | }, 2996 | "hoverColor": { 2997 | "__type__": "cc.Color", 2998 | "r": 255, 2999 | "g": 255, 3000 | "b": 255, 3001 | "a": 255 3002 | }, 3003 | "duration": 0.1, 3004 | "zoomScale": 1.2, 3005 | "clickEvents": [ 3006 | { 3007 | "__id__": 69 3008 | } 3009 | ], 3010 | "_N$interactable": true, 3011 | "_N$enableAutoGrayEffect": false, 3012 | "_N$normalColor": { 3013 | "__type__": "cc.Color", 3014 | "r": 255, 3015 | "g": 255, 3016 | "b": 255, 3017 | "a": 255 3018 | }, 3019 | "_N$disabledColor": { 3020 | "__type__": "cc.Color", 3021 | "r": 255, 3022 | "g": 255, 3023 | "b": 255, 3024 | "a": 255 3025 | }, 3026 | "_N$normalSprite": { 3027 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 3028 | }, 3029 | "_N$pressedSprite": { 3030 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 3031 | }, 3032 | "pressedSprite": { 3033 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 3034 | }, 3035 | "_N$hoverSprite": { 3036 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 3037 | }, 3038 | "hoverSprite": { 3039 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 3040 | }, 3041 | "_N$disabledSprite": { 3042 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 3043 | }, 3044 | "_N$target": { 3045 | "__id__": 64 3046 | }, 3047 | "_id": "36uVsdtgZEsqh95RZQDvIp" 3048 | }, 3049 | { 3050 | "__type__": "cc.ClickEvent", 3051 | "target": { 3052 | "__id__": 2 3053 | }, 3054 | "component": "main", 3055 | "handler": "onClickMosaic", 3056 | "customEventData": "" 3057 | }, 3058 | { 3059 | "__type__": "cc.Node", 3060 | "_name": "btnRadialBlur", 3061 | "_objFlags": 0, 3062 | "_parent": { 3063 | "__id__": 2 3064 | }, 3065 | "_children": [ 3066 | { 3067 | "__id__": 71 3068 | } 3069 | ], 3070 | "_active": true, 3071 | "_level": 2, 3072 | "_components": [ 3073 | { 3074 | "__id__": 73 3075 | }, 3076 | { 3077 | "__id__": 74 3078 | } 3079 | ], 3080 | "_prefab": null, 3081 | "_opacity": 255, 3082 | "_color": { 3083 | "__type__": "cc.Color", 3084 | "r": 255, 3085 | "g": 255, 3086 | "b": 255, 3087 | "a": 255 3088 | }, 3089 | "_contentSize": { 3090 | "__type__": "cc.Size", 3091 | "width": 100, 3092 | "height": 40 3093 | }, 3094 | "_anchorPoint": { 3095 | "__type__": "cc.Vec2", 3096 | "x": 0.5, 3097 | "y": 0.5 3098 | }, 3099 | "_position": { 3100 | "__type__": "cc.Vec3", 3101 | "x": 261, 3102 | "y": -317, 3103 | "z": 0 3104 | }, 3105 | "_scale": { 3106 | "__type__": "cc.Vec3", 3107 | "x": 1, 3108 | "y": 1, 3109 | "z": 1 3110 | }, 3111 | "_rotationX": 0, 3112 | "_rotationY": 0, 3113 | "_quat": { 3114 | "__type__": "cc.Quat", 3115 | "x": 0, 3116 | "y": 0, 3117 | "z": 0, 3118 | "w": 1 3119 | }, 3120 | "_skewX": 0, 3121 | "_skewY": 0, 3122 | "_zIndex": 0, 3123 | "groupIndex": 0, 3124 | "_id": "90JfdY2RlI+ah4pIqstbZG" 3125 | }, 3126 | { 3127 | "__type__": "cc.Node", 3128 | "_name": "Label", 3129 | "_objFlags": 0, 3130 | "_parent": { 3131 | "__id__": 70 3132 | }, 3133 | "_children": [], 3134 | "_active": true, 3135 | "_level": 0, 3136 | "_components": [ 3137 | { 3138 | "__id__": 72 3139 | } 3140 | ], 3141 | "_prefab": null, 3142 | "_opacity": 255, 3143 | "_color": { 3144 | "__type__": "cc.Color", 3145 | "r": 0, 3146 | "g": 0, 3147 | "b": 0, 3148 | "a": 255 3149 | }, 3150 | "_contentSize": { 3151 | "__type__": "cc.Size", 3152 | "width": 100, 3153 | "height": 40 3154 | }, 3155 | "_anchorPoint": { 3156 | "__type__": "cc.Vec2", 3157 | "x": 0.5, 3158 | "y": 0.5 3159 | }, 3160 | "_position": { 3161 | "__type__": "cc.Vec3", 3162 | "x": 0, 3163 | "y": 0, 3164 | "z": 0 3165 | }, 3166 | "_scale": { 3167 | "__type__": "cc.Vec3", 3168 | "x": 1, 3169 | "y": 1, 3170 | "z": 1 3171 | }, 3172 | "_rotationX": 0, 3173 | "_rotationY": 0, 3174 | "_quat": { 3175 | "__type__": "cc.Quat", 3176 | "x": 0, 3177 | "y": 0, 3178 | "z": 0, 3179 | "w": 1 3180 | }, 3181 | "_skewX": 0, 3182 | "_skewY": 0, 3183 | "_zIndex": 0, 3184 | "groupIndex": 0, 3185 | "_id": "b2aRwfljZPLL2A8Mz6pzRP" 3186 | }, 3187 | { 3188 | "__type__": "cc.Label", 3189 | "_name": "", 3190 | "_objFlags": 0, 3191 | "node": { 3192 | "__id__": 71 3193 | }, 3194 | "_enabled": true, 3195 | "_srcBlendFactor": 1, 3196 | "_dstBlendFactor": 771, 3197 | "_useOriginalSize": false, 3198 | "_string": "径向模糊", 3199 | "_N$string": "径向模糊", 3200 | "_fontSize": 20, 3201 | "_lineHeight": 40, 3202 | "_enableWrapText": false, 3203 | "_N$file": null, 3204 | "_isSystemFontUsed": true, 3205 | "_spacingX": 0, 3206 | "_N$horizontalAlign": 1, 3207 | "_N$verticalAlign": 1, 3208 | "_N$fontFamily": "Arial", 3209 | "_N$overflow": 1, 3210 | "_id": "13XiAwcgNFW47p81z8gdrY" 3211 | }, 3212 | { 3213 | "__type__": "cc.Sprite", 3214 | "_name": "", 3215 | "_objFlags": 0, 3216 | "node": { 3217 | "__id__": 70 3218 | }, 3219 | "_enabled": true, 3220 | "_srcBlendFactor": 770, 3221 | "_dstBlendFactor": 771, 3222 | "_spriteFrame": { 3223 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 3224 | }, 3225 | "_type": 1, 3226 | "_sizeMode": 0, 3227 | "_fillType": 0, 3228 | "_fillCenter": { 3229 | "__type__": "cc.Vec2", 3230 | "x": 0, 3231 | "y": 0 3232 | }, 3233 | "_fillStart": 0, 3234 | "_fillRange": 0, 3235 | "_isTrimmedMode": true, 3236 | "_state": 0, 3237 | "_atlas": null, 3238 | "_id": "3cYB5FIf1JiL5WACBxx6AP" 3239 | }, 3240 | { 3241 | "__type__": "cc.Button", 3242 | "_name": "", 3243 | "_objFlags": 0, 3244 | "node": { 3245 | "__id__": 70 3246 | }, 3247 | "_enabled": true, 3248 | "transition": 2, 3249 | "pressedColor": { 3250 | "__type__": "cc.Color", 3251 | "r": 255, 3252 | "g": 255, 3253 | "b": 255, 3254 | "a": 255 3255 | }, 3256 | "hoverColor": { 3257 | "__type__": "cc.Color", 3258 | "r": 255, 3259 | "g": 255, 3260 | "b": 255, 3261 | "a": 255 3262 | }, 3263 | "duration": 0.1, 3264 | "zoomScale": 1.2, 3265 | "clickEvents": [ 3266 | { 3267 | "__id__": 75 3268 | } 3269 | ], 3270 | "_N$interactable": true, 3271 | "_N$enableAutoGrayEffect": false, 3272 | "_N$normalColor": { 3273 | "__type__": "cc.Color", 3274 | "r": 255, 3275 | "g": 255, 3276 | "b": 255, 3277 | "a": 255 3278 | }, 3279 | "_N$disabledColor": { 3280 | "__type__": "cc.Color", 3281 | "r": 255, 3282 | "g": 255, 3283 | "b": 255, 3284 | "a": 255 3285 | }, 3286 | "_N$normalSprite": { 3287 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 3288 | }, 3289 | "_N$pressedSprite": { 3290 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 3291 | }, 3292 | "pressedSprite": { 3293 | "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" 3294 | }, 3295 | "_N$hoverSprite": { 3296 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 3297 | }, 3298 | "hoverSprite": { 3299 | "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" 3300 | }, 3301 | "_N$disabledSprite": { 3302 | "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" 3303 | }, 3304 | "_N$target": { 3305 | "__id__": 70 3306 | }, 3307 | "_id": "9c7tuNuyhKyK4pP4NBVq1M" 3308 | }, 3309 | { 3310 | "__type__": "cc.ClickEvent", 3311 | "target": { 3312 | "__id__": 2 3313 | }, 3314 | "component": "main", 3315 | "handler": "onClickRadialBlur", 3316 | "customEventData": "" 3317 | }, 3318 | { 3319 | "__type__": "cc.Canvas", 3320 | "_name": "", 3321 | "_objFlags": 0, 3322 | "node": { 3323 | "__id__": 2 3324 | }, 3325 | "_enabled": true, 3326 | "_designResolution": { 3327 | "__type__": "cc.Size", 3328 | "width": 1280, 3329 | "height": 720 3330 | }, 3331 | "_fitWidth": false, 3332 | "_fitHeight": true, 3333 | "_id": "b6q/97He1JPo3A7GGWpVAY" 3334 | }, 3335 | { 3336 | "__type__": "7e20eIoLstNeaH4lEvd6xrG", 3337 | "_name": "", 3338 | "_objFlags": 0, 3339 | "node": { 3340 | "__id__": 2 3341 | }, 3342 | "_enabled": true, 3343 | "frame1": { 3344 | "__uuid__": "284cf4f9-b7ef-44c1-ad4f-90e34a6d1db9" 3345 | }, 3346 | "frame2": { 3347 | "__uuid__": "29d5d470-63a5-495e-a5ac-33e1f0a6e10a" 3348 | }, 3349 | "spImage": { 3350 | "__id__": 9 3351 | }, 3352 | "_id": "e2uVN93/BP6rgKZanxc7Nb" 3353 | } 3354 | ] -------------------------------------------------------------------------------- /assets/main.fire.meta: -------------------------------------------------------------------------------- 1 | { 2 | "ver": "1.0.0", 3 | "uuid": "9015cc34-89b1-488e-ae74-1186411646cc", 4 | "asyncLoadAssets": false, 5 | "autoReleaseAssets": false, 6 | "subMetas": {} 7 | } -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "experimentalDecorators": true 6 | }, 7 | "exclude": [ 8 | "node_modules", 9 | ".vscode", 10 | "library", 11 | "local", 12 | "settings", 13 | "temp" 14 | ] 15 | } -------------------------------------------------------------------------------- /project.json: -------------------------------------------------------------------------------- 1 | { 2 | "engine": "cocos-creator-js", 3 | "packages": "packages" 4 | } -------------------------------------------------------------------------------- /settings/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "cocos-analytics": { 3 | "appID": "13798", 4 | "appSecret": "959b3ac0037d0f3c2fdce94f8421a9b2", 5 | "channel": "", 6 | "enable": false, 7 | "version": "" 8 | }, 9 | "collision-matrix": [ 10 | [ 11 | true 12 | ] 13 | ], 14 | "design-resolution-height": 640, 15 | "design-resolution-width": 960, 16 | "excluded-modules": [], 17 | "fit-height": true, 18 | "fit-width": false, 19 | "group-list": [ 20 | "default" 21 | ], 22 | "simulator-orientation": false, 23 | "simulator-resolution": { 24 | "height": 640, 25 | "width": 960 26 | }, 27 | "start-scene": "9015cc34-89b1-488e-ae74-1186411646cc", 28 | "use-customize-simulator": false, 29 | "use-project-simulator-setting": false 30 | } -------------------------------------------------------------------------------- /snapshot/gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinsusie/creator_2_0_material_demo/8ab3d754b7906c2b1163b490eec9210327ffd06c/snapshot/gray.jpg -------------------------------------------------------------------------------- /snapshot/normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinsusie/creator_2_0_material_demo/8ab3d754b7906c2b1163b490eec9210327ffd06c/snapshot/normal.jpg -------------------------------------------------------------------------------- /snapshot/overlay.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinsusie/creator_2_0_material_demo/8ab3d754b7906c2b1163b490eec9210327ffd06c/snapshot/overlay.jpg -------------------------------------------------------------------------------- /snapshot/rain.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinsusie/creator_2_0_material_demo/8ab3d754b7906c2b1163b490eec9210327ffd06c/snapshot/rain.jpg -------------------------------------------------------------------------------- /snapshot/wave.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/colinsusie/creator_2_0_material_demo/8ab3d754b7906c2b1163b490eec9210327ffd06c/snapshot/wave.jpg --------------------------------------------------------------------------------