feat: 增加其他场景切换效果

This commit is contained in:
ifengzp 2024-09-23 09:08:09 +08:00
parent 1e5bcbe4fc
commit 340f65287e
126 changed files with 7938 additions and 21 deletions

View File

@ -192,7 +192,7 @@
"array": [ "array": [
0, 0,
0, 0,
769.0305585605815, 452.93128617926146,
0, 0,
0, 0,
0, 0,
@ -2225,7 +2225,7 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "SceneTransition", "_name": "ScreenTransition",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 1 "__id__": 1
@ -2260,8 +2260,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 667,
0, 375,
0, 0,
0, 0,
0, 0,
@ -2283,7 +2283,7 @@
"_is3DNode": false, "_is3DNode": false,
"_groupIndex": 0, "_groupIndex": 0,
"groupIndex": 0, "groupIndex": 0,
"_id": "eeaY/+TfZLz4P/SykmO5T3" "_id": "e5RQj3G6VEhL2bHSWO3bD2"
}, },
{ {
"__type__": "1cd9dHF3nRI24w/zAzyk3Q3", "__type__": "1cd9dHF3nRI24w/zAzyk3Q3",
@ -2295,10 +2295,31 @@
"_enabled": true, "_enabled": true,
"time": 0, "time": 0,
"materials": [ "materials": [
{
"__uuid__": "94d8d991-9e84-4d88-89f7-33d14f1bc9bf"
},
{
"__uuid__": "c27b1317-6f94-4d6c-9760-adee279b2ad4"
},
{
"__uuid__": "acd92272-4481-49c6-81ef-5ae28e699ecf"
},
{
"__uuid__": "dbf06bcd-8024-4f08-a535-08f7383edf00"
},
{
"__uuid__": "985a2d90-fd09-4d07-9d94-a50d5af116d9"
},
{ {
"__uuid__": "a869ac13-ffed-4334-b5df-1251273f2b07" "__uuid__": "a869ac13-ffed-4334-b5df-1251273f2b07"
},
{
"__uuid__": "ee73e8c0-5ff0-486a-bcdf-dec85b04755b"
},
{
"__uuid__": "6dd2566a-a5ef-48ff-a3a2-521163be1e1e"
} }
], ],
"_id": "606YRpjk1JGqOLoeXBmJQ3" "_id": "e6NgBxPOVL9YQp8rpWon4s"
} }
] ]

View File

@ -13,7 +13,6 @@ enum sceneList {
'Specular_gloss' = '镜面光泽效果shader', 'Specular_gloss' = '镜面光泽效果shader',
'Metaball' = '融球效果shader', 'Metaball' = '融球效果shader',
'Bullet_Tracking' = '子弹跟踪效果', 'Bullet_Tracking' = '子弹跟踪效果',
'SwitchScene__SquaresWire' = '场景切换Squares Wire',
'Circle_avatar' = '圆形头像shader', 'Circle_avatar' = '圆形头像shader',
'Coin_fly_to_wallet' = '金币落袋效果', 'Coin_fly_to_wallet' = '金币落袋效果',
'Infinite_bg_scroll' = '背景无限滚动', 'Infinite_bg_scroll' = '背景无限滚动',
@ -22,6 +21,14 @@ enum sceneList {
'Joystick' = '遥控杆', 'Joystick' = '遥控杆',
'Filter' = '颜色滤镜', 'Filter' = '颜色滤镜',
'Photo_gallery' = '渐变过渡的相册shader', 'Photo_gallery' = '渐变过渡的相册shader',
'SwitchScene__DoomScreen' = '场景切换效果一',
'SwitchScene__GlitchMemories' = '场景切换效果二',
'SwitchScene__Morph' = '场景切换效果三',
'SwitchScene__Perlin' = '场景切换效果四',
'SwitchScene__PolkaDotsCurtain' = '场景切换效果五',
'SwitchScene__SquaresWire' = '场景切换效果六',
'SwitchScene__Strip' = '场景切换效果七',
'SwitchScene__Wind' = '场景切换效果八',
} }
@ccclass @ccclass

View File

@ -31,9 +31,10 @@ export default class Transition extends cc.Component {
cc.director.on('switchSceneByTransition', this.switchSceneByTransition.bind(this)); cc.director.on('switchSceneByTransition', this.switchSceneByTransition.bind(this));
} }
switchSceneByTransition() { switchSceneByTransition(index) {
this.materialIndex = this.materialIndex + 1 > this.materials.length ? 0 : this.materialIndex + 1; this.materialIndex = Number(index || 0);
this.loadScene('Scene/Home/Home', 'Canvas/Main Camera', 'Canvas/Main Camera'); this.updateSpriteMaterial();
setTimeout(() => this.loadScene('Scene/Home/Home', 'Canvas/Main Camera', 'Canvas/Main Camera'));
} }
init() { init() {
@ -85,6 +86,7 @@ export default class Transition extends cc.Component {
let newMaterial = cc.MaterialVariant.create(this.materials[this.materialIndex], this._sprite); let newMaterial = cc.MaterialVariant.create(this.materials[this.materialIndex], this._sprite);
newMaterial.setProperty('texture', this._texture1); newMaterial.setProperty('texture', this._texture1);
newMaterial.setProperty('texture2', this._texture2); newMaterial.setProperty('texture2', this._texture2);
if (this.materialIndex == 6)
newMaterial.setProperty('screenSize', new Float32Array([this._texture2.width, this._texture2.height])); newMaterial.setProperty('screenSize', new Float32Array([this._texture2.width, this._texture2.height]));
this._sprite.setMaterial(0, newMaterial); this._sprite.setMaterial(0, newMaterial);

View File

@ -1,6 +1,6 @@
{ {
"ver": "1.0.1", "ver": "1.0.1",
"uuid": "d1c25e17-c4ab-49e9-914a-946b38dc5365", "uuid": "fc466dc2-e18c-4003-82ae-68cfc1269b29",
"isSubpackage": false, "isSubpackage": false,
"subpackageName": "", "subpackageName": "",
"subMetas": {} "subMetas": {}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "56aaf958-2440-4235-bc06-c174b6779619",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,117 @@
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
CCEffect %{
techniques:
- passes:
- vert: vs
frag: fs
blendState:
targets:
- blend: true
rasterizerState:
cullMode: none
properties:
bars: { value: 50, editor: { tooltip: "列数" }}
amplitude: { value: 2, editor: { tooltip: "速度0向下移动时没有变化值越高一些元素移动得更快" }}
noise: { value: 0.1, editor: { tooltip: "速度的离散程度0 = 无噪声1 = 噪声很大" }}
frequency: { value: 0.5, editor: { tooltip: "水平速度变化:值越大,波浪越短" }}
dripScale: { value: 0.5, editor: { tooltip: "屏幕两侧条形黏连的程度0 = 无滴落1 = 曲线滴落" }}
time: { value: 0 }
}%
CCProgram vs %{
precision highp float;
#include <cc-global>
#include <cc-local>
in vec3 a_position;
in vec4 a_color;
out vec4 v_color;
in vec2 a_uv0;
out vec2 v_uv0;
void main () {
vec4 pos = vec4(a_position, 1);
pos = cc_matViewProj * pos;
v_uv0 = a_uv0;
v_color = a_color;
gl_Position = pos;
}
}%
CCProgram fs %{
precision highp float;
uniform sampler2D texture;
uniform sampler2D texture2;
uniform DoomScreen {
float bars;
float amplitude;
float noise;
float frequency;
float dripScale;
float time;
};
float progress = time;
in mediump vec2 v_uv0;
in vec4 v_color;
vec4 getFromColor(vec2 uv) {
return texture(texture, uv);
}
vec4 getToColor(vec2 uv) {
return texture(texture2, uv);
}
float rand(int num) {
return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num)));
}
float wave(int num) {
// 根据传入的索引值计算波浪的频率
float fn = float(num) * frequency * 0.1 * float(bars);
return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn + 10.0) * 0.3) / 2.0 + 0.5;
}
float drip(int num) {
// 根据传入的索引值计算滴水效果的幅度
return sin(float(num) / float(bars - 1.0) * 3.141592) * dripScale;
}
// 计算条的位置
float pos(int num) {
// 如果没有噪声,则返回波浪效果;否则使用波浪效果和随机数进行混合
return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num));
}
vec4 transition(vec2 uv) {
// 根据水平位置计算当前条的索引值
int bar = int(uv.x * (float(bars)));
// 根据当前条的位置计算缩放比例和进度
float scale = 1.0 + pos(bar) * amplitude;
float phase = progress * scale;
// 计算垂直位置的比例
float posY = uv.y / vec2(1.0).y;
vec2 p;
vec4 c;
// 根据进度判断使用起始颜色还是目标颜色
if (phase + posY < 1.0) {
// 根据当前条的位置和进度计算新的垂直位置
p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy;
// 获取起始颜色
c = getFromColor(p);
} else {
// 获取目标颜色
p = uv.xy / vec2(1.0).xy;
c = getToColor(p);
}
return c;
}
void main () {
gl_FragColor = v_color * transition(v_uv0);
}
}%

View File

@ -0,0 +1,17 @@
{
"ver": "1.0.25",
"uuid": "6af67cb9-1430-48c0-8704-792a7406fa41",
"compiledShaders": [
{
"glsl1": {
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n pos = cc_matViewProj * pos;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform float bars;\nuniform float amplitude;\nuniform float noise;\nuniform float frequency;\nuniform float dripScale;\nuniform float time;\nfloat progress = time;\nvarying mediump vec2 v_uv0;\nvarying vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nfloat rand(int num) {\n return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num)));\n}\nfloat wave(int num) {\n float fn = float(num) * frequency * 0.1 * float(bars);\n return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn + 10.0) * 0.3) / 2.0 + 0.5;\n}\nfloat drip(int num) {\n return sin(float(num) / float(bars - 1.0) * 3.141592) * dripScale;\n}\nfloat pos(int num) {\n return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num));\n}\nvec4 transition(vec2 uv) {\n int bar = int(uv.x * (float(bars)));\n float scale = 1.0 + pos(bar) * amplitude;\n float phase = progress * scale;\n float posY = uv.y / vec2(1.0).y;\n vec2 p;\n vec4 c;\n if (phase + posY < 1.0) {\n p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy;\n c = getFromColor(p);\n } else {\n p = uv.xy / vec2(1.0).xy;\n c = getToColor(p);\n }\n return c;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
},
"glsl3": {
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\nin vec2 a_uv0;\nout vec2 v_uv0;\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n pos = cc_matViewProj * pos;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform DoomScreen {\n float bars;\n float amplitude;\n float noise;\n float frequency;\n float dripScale;\n float time;\n};\nfloat progress = time;\nin mediump vec2 v_uv0;\nin vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nfloat rand(int num) {\n return fract(mod(float(num) * 67123.313, 12.0) * sin(float(num) * 10.3) * cos(float(num)));\n}\nfloat wave(int num) {\n float fn = float(num) * frequency * 0.1 * float(bars);\n return cos(fn * 0.5) * cos(fn * 0.13) * sin((fn + 10.0) * 0.3) / 2.0 + 0.5;\n}\nfloat drip(int num) {\n return sin(float(num) / float(bars - 1.0) * 3.141592) * dripScale;\n}\nfloat pos(int num) {\n return (noise == 0.0 ? wave(num) : mix(wave(num), rand(num), noise)) + (dripScale == 0.0 ? 0.0 : drip(num));\n}\nvec4 transition(vec2 uv) {\n int bar = int(uv.x * (float(bars)));\n float scale = 1.0 + pos(bar) * amplitude;\n float phase = progress * scale;\n float posY = uv.y / vec2(1.0).y;\n vec2 p;\n vec4 c;\n if (phase + posY < 1.0) {\n p = vec2(uv.x, uv.y + mix(0.0, vec2(1.0).y, phase)) / vec2(1.0).xy;\n c = getFromColor(p);\n } else {\n p = uv.xy / vec2(1.0).xy;\n c = getToColor(p);\n }\n return c;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
}
}
],
"subMetas": {}
}

View File

@ -0,0 +1,24 @@
{
"__type__": "cc.Material",
"_name": "DoomScreen",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "6af67cb9-1430-48c0-8704-792a7406fa41"
},
"_techniqueIndex": 0,
"_techniqueData": {
"0": {
"defines": {},
"props": {
"bars": 50,
"texture": {
"__uuid__": "bdc5b1b7-faf4-4186-9895-f5ee7ed31093"
},
"texture2": {
"__uuid__": "c8b7f468-dad7-41d2-892a-13b1e106ec06"
}
}
}
}
}

View File

@ -0,0 +1,6 @@
{
"ver": "1.0.3",
"uuid": "94d8d991-9e84-4d88-89f7-33d14f1bc9bf",
"dataAsSubAsset": null,
"subMetas": {}
}

View File

@ -25,9 +25,9 @@ export default class SwitchScene extends cc.Component {
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this); this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
} }
switchSceneByTransition() { switchSceneByTransition(event, value) {
cc.director.emit('setBackBtnVisibility', false); cc.director.emit('setBackBtnVisibility', false);
cc.director.emit('switchSceneByTransition'); cc.director.emit('switchSceneByTransition', value);
} }
playTransitionAnimation() { playTransitionAnimation() {
@ -78,7 +78,6 @@ export default class SwitchScene extends cc.Component {
let newMaterial = cc.MaterialVariant.create(this.material, this.bgSprite); let newMaterial = cc.MaterialVariant.create(this.material, this.bgSprite);
newMaterial.setProperty('texture', this.spriteFrame1._texture); newMaterial.setProperty('texture', this.spriteFrame1._texture);
newMaterial.setProperty('texture2', this.spriteFrame2._texture); newMaterial.setProperty('texture2', this.spriteFrame2._texture);
newMaterial.setProperty('screenSize', new Float32Array([cc.winSize.width, cc.winSize.height]));
newMaterial.setProperty('time', 0.25); newMaterial.setProperty('time', 0.25);
this.spriteFrame1._texture.setFlipY(true); this.spriteFrame1._texture.setFlipY(true);

View File

@ -1,6 +1,6 @@
{ {
"ver": "1.0.5", "ver": "1.0.5",
"uuid": "d3f4aa83-177e-4b31-b4f8-168797fa6b26", "uuid": "de7b06f3-2c55-4d64-bf64-8262f16171ce",
"isPlugin": false, "isPlugin": false,
"loadPluginInWeb": true, "loadPluginInWeb": true,
"loadPluginInNative": true, "loadPluginInNative": true,

View File

@ -0,0 +1,740 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 8
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "832db263-aa28-48b6-ae75-8a0721103b06"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 512,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
452.93128617926146,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "de7b0bzLFVNZL9kgmLxYXHO",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"separator": {
"__id__": 8
},
"spriteFrame1": {
"__uuid__": "5c7f62b2-44b3-4ef2-b133-825e35b654ec"
},
"spriteFrame2": {
"__uuid__": "145047e6-73a5-4a19-bd7c-9dee1e5bc19f"
},
"bgSprite": {
"__id__": 10
},
"material": {
"__uuid__": "94d8d991-9e84-4d88-89f7-33d14f1bc9bf"
},
"_id": "bcrHoyt8lHbpmm6ciYSB5M"
},
{
"__type__": "cc.Node",
"_name": "Separator",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 171,
"b": 23,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
333,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "00zwOFnw9A9Y2jJcAfpxGt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5c3bb932-6c3c-468f-88a9-c8c61d458641"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "bfovdQprtLZrbQA9328iTr"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b70P96s8FD1LitaZ7aobMA"
},
{
"__type__": "cc.Node",
"_name": "Bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
-1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "34YKVYdF5MoYlFN+Zfb6wk"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1024,
"_originalHeight": 445,
"_id": "711M5JfuBPs5F7P5bDVb/1"
},
{
"__type__": "cc.Node",
"_name": "Btn",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1477,
"height": 118
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
528.7,
0,
0,
0,
0,
1,
0.7,
0.7,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcVNNAEfFEJL7tftaCUB7n"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 15
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 13
},
"_id": "fdJg28i7pE6pi4D1ovRRp0"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "de7b0bzLFVNZL9kgmLxYXHO",
"handler": "switchSceneByTransition",
"customEventData": "0"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "86714285-13db-44f6-86aa-11838e0d4831"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c1sR5klVZHraEr68/UTkLE"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 17,
"_left": 0,
"_right": 0,
"_top": 180,
"_bottom": 0,
"_verticalCenter": 157.942,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "a6rm0uXY9DlbNNnoWq9hN0"
}
]

View File

@ -0,0 +1,7 @@
{
"ver": "1.2.6",
"uuid": "832db263-aa28-48b6-ae75-8a0721103b06",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "b8632817-6ac9-4af9-a8dc-8c391dd859e6",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "fba8ea3c-e39c-495c-a135-ccb2c418ca04",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg1": {
"ver": "1.0.4",
"uuid": "5c7f62b2-44b3-4ef2-b133-825e35b654ec",
"rawTextureUuid": "fba8ea3c-e39c-495c-a135-ccb2c418ca04",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "508bd902-9298-4b07-a5a9-883e21c06a45",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg2": {
"ver": "1.0.4",
"uuid": "145047e6-73a5-4a19-bd7c-9dee1e5bc19f",
"rawTextureUuid": "508bd902-9298-4b07-a5a9-883e21c06a45",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "eb7a2ae2-9809-4852-adee-c3a96203ddd4",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1477,
"height": 118,
"platformSettings": {},
"subMetas": {
"btn": {
"ver": "1.0.4",
"uuid": "5c37c465-ad63-440a-a30a-7ce4938e0fb9",
"rawTextureUuid": "eb7a2ae2-9809-4852-adee-c3a96203ddd4",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1477,
"height": 118,
"rawWidth": 1477,
"rawHeight": 118,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "10b61f45-6dcc-47e8-87cf-1859b81ee17b",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "04fc26da-4e75-425b-809a-430d8b20b029",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,94 @@
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
CCEffect %{
techniques:
- passes:
- vert: vs
frag: fs
blendState:
targets:
- blend: true
rasterizerState:
cullMode: none
properties:
texture: { value: white }
time: {value: 0}
}%
CCProgram vs %{
precision highp float;
#include <cc-global>
#include <cc-local>
in vec3 a_position;
in vec4 a_color;
out vec4 v_color;
#if USE_TEXTURE
in vec2 a_uv0;
out vec2 v_uv0;
#endif
void main () {
vec4 pos = vec4(a_position, 1);
#if CC_USE_MODEL
pos = cc_matViewProj * cc_matWorld * pos;
#else
pos = cc_matViewProj * pos;
#endif
#if USE_TEXTURE
v_uv0 = a_uv0;
#endif
v_color = a_color;
gl_Position = pos;
}
}%
CCProgram fs %{
precision highp float;
uniform sampler2D texture;
uniform sampler2D texture2;
uniform Common {
float time;
};
float progress = time;
in mediump vec2 v_uv0;
in vec4 v_color;
vec4 getFromColor(vec2 uv) {
return texture(texture, uv);
}
vec4 getToColor(vec2 uv) {
return texture(texture2, uv);
}
vec4 transition(vec2 p) {
// 计算块索引每个块大小为16x16
vec2 block = floor(p.xy / vec2(16));
// 计算UV噪声根据进度调整UV噪声
vec2 uv_noise = block / vec2(64);
uv_noise += floor(vec2(progress) * vec2(1200.0, 3500.0)) / vec2(64);
// 计算扭曲距离,并算出各颜色通道的偏移值
vec2 dist = progress > 0.0 ? (fract(uv_noise) - 0.5) * 0.3 * (1.0 - progress) : vec2(0.0);
vec2 red = p + dist * 0.2;
vec2 green = p + dist * 0.3;
vec2 blue = p + dist * 0.5;
return vec4(
mix(getFromColor(red).r, getToColor(red).r, progress),
mix(getFromColor(green).g, getToColor(green).g, progress),
mix(getFromColor(blue).b, getToColor(blue).b, progress),
1.0
);
}
void main () {
gl_FragColor = v_color * transition(v_uv0);
}
}%

View File

@ -0,0 +1,17 @@
{
"ver": "1.0.25",
"uuid": "478d6745-6406-4f03-84f4-194af9a5b89c",
"compiledShaders": [
{
"glsl1": {
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\n precision highp float;\n uniform sampler2D texture;\n uniform sampler2D texture2;\n uniform float time;\n float progress = time;\n varying mediump vec2 v_uv0;\n varying vec4 v_color;\n vec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n }\n vec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n }\n vec4 transition(vec2 p) {\n vec2 block = floor(p.xy / vec2(16));\n vec2 uv_noise = block / vec2(64);\n uv_noise += floor(vec2(progress) * vec2(1200.0, 3500.0)) / vec2(64);\n vec2 dist = progress > 0.0 ? (fract(uv_noise) - 0.5) * 0.3 * (1.0 - progress) : vec2(0.0);\n vec2 red = p + dist * 0.2;\n vec2 green = p + dist * 0.3;\n vec2 blue = p + dist * 0.5;\n return vec4(\n mix(getFromColor(red).r, getToColor(red).r, progress),\n mix(getFromColor(green).g, getToColor(green).g, progress),\n mix(getFromColor(blue).b, getToColor(blue).b, progress),\n 1.0\n );\n}\n void main () {\n gl_FragColor = v_color * transition(v_uv0);\n }"
},
"glsl3": {
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\n precision highp float;\n uniform sampler2D texture;\n uniform sampler2D texture2;\n uniform Common {\n float time;\n };\n float progress = time;\n in mediump vec2 v_uv0;\n in vec4 v_color;\n vec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n }\n vec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n }\n vec4 transition(vec2 p) {\n vec2 block = floor(p.xy / vec2(16));\n vec2 uv_noise = block / vec2(64);\n uv_noise += floor(vec2(progress) * vec2(1200.0, 3500.0)) / vec2(64);\n vec2 dist = progress > 0.0 ? (fract(uv_noise) - 0.5) * 0.3 * (1.0 - progress) : vec2(0.0);\n vec2 red = p + dist * 0.2;\n vec2 green = p + dist * 0.3;\n vec2 blue = p + dist * 0.5;\n return vec4(\n mix(getFromColor(red).r, getToColor(red).r, progress),\n mix(getFromColor(green).g, getToColor(green).g, progress),\n mix(getFromColor(blue).b, getToColor(blue).b, progress),\n 1.0\n );\n}\n void main () {\n gl_FragColor = v_color * transition(v_uv0);\n }"
}
}
],
"subMetas": {}
}

View File

@ -0,0 +1,17 @@
{
"__type__": "cc.Material",
"_name": "GlitchMemories",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "478d6745-6406-4f03-84f4-194af9a5b89c"
},
"_techniqueIndex": 0,
"_techniqueData": {
"0": {
"defines": {
"USE_TEXTURE": true
}
}
}
}

View File

@ -0,0 +1,6 @@
{
"ver": "1.0.3",
"uuid": "c27b1317-6f94-4d6c-9760-adee279b2ad4",
"dataAsSubAsset": null,
"subMetas": {}
}

View File

@ -0,0 +1,740 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 8
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "41a713ba-b1bd-4205-a42a-b1376223ce28"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 512,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
452.93128617926146,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "293d9TMqSxFybRwQO1/AgoY",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"separator": {
"__id__": 8
},
"spriteFrame1": {
"__uuid__": "a448d81c-fa36-426d-affc-78eedc0b3118"
},
"spriteFrame2": {
"__uuid__": "50328db8-b67b-4c51-a2b3-92fbc75407ad"
},
"bgSprite": {
"__id__": 10
},
"material": {
"__uuid__": "c27b1317-6f94-4d6c-9760-adee279b2ad4"
},
"_id": "eb4Wz3kaFGxZqO55QRBDxx"
},
{
"__type__": "cc.Node",
"_name": "Separator",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 171,
"b": 23,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
333,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "00zwOFnw9A9Y2jJcAfpxGt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5c3bb932-6c3c-468f-88a9-c8c61d458641"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "bfovdQprtLZrbQA9328iTr"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b70P96s8FD1LitaZ7aobMA"
},
{
"__type__": "cc.Node",
"_name": "Bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
-1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "34YKVYdF5MoYlFN+Zfb6wk"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1024,
"_originalHeight": 445,
"_id": "711M5JfuBPs5F7P5bDVb/1"
},
{
"__type__": "cc.Node",
"_name": "Btn",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1477,
"height": 118
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
528.7,
0,
0,
0,
0,
1,
0.7,
0.7,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcVNNAEfFEJL7tftaCUB7n"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 15
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 13
},
"_id": "fdJg28i7pE6pi4D1ovRRp0"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "293d9TMqSxFybRwQO1/AgoY",
"handler": "switchSceneByTransition",
"customEventData": "1"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "86714285-13db-44f6-86aa-11838e0d4831"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c1sR5klVZHraEr68/UTkLE"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 17,
"_left": 0,
"_right": 0,
"_top": 180,
"_bottom": 0,
"_verticalCenter": 157.942,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "a6rm0uXY9DlbNNnoWq9hN0"
}
]

View File

@ -0,0 +1,7 @@
{
"ver": "1.2.6",
"uuid": "41a713ba-b1bd-4205-a42a-b1376223ce28",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@ -0,0 +1,88 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class SwitchScene extends cc.Component {
@property(cc.Node) separator = null;
@property(cc.SpriteFrame) spriteFrame1 = null;
@property(cc.SpriteFrame) spriteFrame2 = null;
@property(cc.Sprite) bgSprite = null;
@property(cc.Material) material = null;
private _spriteMaterial: cc.Material;
touchStartPos = cc.Vec2.ZERO;
separatorStartPos = cc.Vec2.ZERO;
start() {
this.bgSprite.spriteFrame.setTexture(this.spriteFrame1._texture);
this.initSpriteMaterial();
this.playTransitionAnimation();
}
onLoad() {
this.separatorStartPos = this.separator.getPosition();
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
}
switchSceneByTransition(event, value) {
cc.director.emit('setBackBtnVisibility', false);
cc.director.emit('switchSceneByTransition', value);
}
playTransitionAnimation() {
let progress = 0;
let targetProgress = cc.winSize.width;
let totalTime = 3;
let startTime = Date.now();
const loop = () => {
if (!this._spriteMaterial || !this.touchStartPos) return;
if (!this.touchStartPos.equals(cc.Vec2.ZERO)) return;
let currentTime = Date.now();
let elapsedTime = (currentTime - startTime) / 1000;
let _progress = (elapsedTime / totalTime) * targetProgress;
progress = Math.min(_progress, targetProgress);
this._spriteMaterial.setProperty('time', progress / cc.winSize.width);
this.separator.setPosition({ x: progress, y: 0 });
if (progress < targetProgress) {
requestAnimationFrame(loop.bind(this));
}
};
loop();
}
onTouchStart(event) {
this.separatorStartPos = this.separator.getPosition();
this.touchStartPos = this.node.convertToNodeSpaceAR(event.getLocation());
}
private onTouchMove(event) {
// 获取当前触摸点的位置
let touchPos = this.node.convertToNodeSpaceAR(event.getLocation());
// 计算触摸点相对于起始位置的偏移量
let offset = touchPos.sub(this.touchStartPos);
let targetPos = this.separatorStartPos.add(offset);
let targetX = Math.max(0, Math.min(targetPos.x, cc.winSize.width));
this.separator.setPosition({
x: targetX,
y: 0
});
this._spriteMaterial.setProperty('time', targetX / cc.winSize.width);
}
initSpriteMaterial() {
let newMaterial = cc.MaterialVariant.create(this.material, this.bgSprite);
newMaterial.setProperty('texture', this.spriteFrame1._texture);
newMaterial.setProperty('texture2', this.spriteFrame2._texture);
newMaterial.setProperty('time', 0.25);
this.spriteFrame1._texture.setFlipY(true);
this.spriteFrame2._texture.setFlipY(true);
this.bgSprite.setMaterial(0, newMaterial);
this._spriteMaterial = newMaterial;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "293d94cc-a92c-45c9-b470-40ed7f020a18",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "8b5c5f36-f86b-4518-9b61-3484183b20b4",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "ee75dca6-9cb2-4f08-b996-5e990ded448d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg1": {
"ver": "1.0.4",
"uuid": "a448d81c-fa36-426d-affc-78eedc0b3118",
"rawTextureUuid": "ee75dca6-9cb2-4f08-b996-5e990ded448d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "d6c1cbd3-3ac4-4297-b2ac-b833bc5fed54",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg2": {
"ver": "1.0.4",
"uuid": "50328db8-b67b-4c51-a2b3-92fbc75407ad",
"rawTextureUuid": "d6c1cbd3-3ac4-4297-b2ac-b833bc5fed54",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "623adef2-9f2d-4d56-848d-380fca791f90",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1477,
"height": 118,
"platformSettings": {},
"subMetas": {
"btn": {
"ver": "1.0.4",
"uuid": "9d65fe06-9a25-453d-a008-fcc096b3fc2b",
"rawTextureUuid": "623adef2-9f2d-4d56-848d-380fca791f90",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1477,
"height": 118,
"rawWidth": 1477,
"rawHeight": 118,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "e3428f3b-5920-446c-a9ca-f7a303952872",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "242c1c65-a965-450a-8df4-364aa907e5ad",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,93 @@
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
CCEffect %{
techniques:
- passes:
- vert: vs
frag: fs
blendState:
targets:
- blend: true
rasterizerState:
cullMode: none
properties:
texture: { value: white }
strength: {value: 0.1}
time: {value: 0}
}%
CCProgram vs %{
precision highp float;
#include <cc-global>
#include <cc-local>
in vec3 a_position;
in vec4 a_color;
out vec4 v_color;
#if USE_TEXTURE
in vec2 a_uv0;
out vec2 v_uv0;
#endif
void main () {
vec4 pos = vec4(a_position, 1);
#if CC_USE_MODEL
pos = cc_matViewProj * cc_matWorld * pos;
#else
pos = cc_matViewProj * pos;
#endif
#if USE_TEXTURE
v_uv0 = a_uv0;
#endif
v_color = a_color;
gl_Position = pos;
}
}%
CCProgram fs %{
precision highp float;
uniform sampler2D texture;
uniform sampler2D texture2;
uniform Common {
float strength;
float time;
};
float progress = time;
in mediump vec2 v_uv0;
in vec4 v_color;
vec4 getFromColor(vec2 uv) {
return texture(texture, uv);
}
vec4 getToColor(vec2 uv) {
return texture(texture2, uv);
}
vec4 transition(vec2 p) {
// 获取起始颜色和目标颜色
vec4 ca = getFromColor(p);
vec4 cb = getToColor(p);
// 计算起始和目标颜色的偏移向量
vec2 oa = (((ca.rg + ca.b) * 0.5) * 2.0 - 1.0);
vec2 ob = (((cb.rg + cb.b) * 0.5) * 2.0 - 1.0);
// 在起始和目标偏移向量之间进行插值,并乘以强度
vec2 oc = mix(oa, ob, 0.5) * strength;
// 根据进度计算权重
float w0 = progress;
float w1 = 1.0 - w0;
// 使用混合函数混合起始颜色和目标颜色,根据进度进行插值
return mix(getFromColor(p + oc * w0), getToColor(p - oc * w1), progress);
}
void main () {
gl_FragColor = v_color * transition(v_uv0);
}
}%

View File

@ -0,0 +1,17 @@
{
"ver": "1.0.25",
"uuid": "fde88b10-e301-436f-8d79-5093c0a12f12",
"compiledShaders": [
{
"glsl1": {
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform float strength;\nuniform float time;\nfloat progress = time;\nvarying mediump vec2 v_uv0;\nvarying vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nvec4 transition(vec2 p) {\n vec4 ca = getFromColor(p);\n vec4 cb = getToColor(p);\n vec2 oa = (((ca.rg + ca.b) * 0.5) * 2.0 - 1.0);\n vec2 ob = (((cb.rg + cb.b) * 0.5) * 2.0 - 1.0);\n vec2 oc = mix(oa, ob, 0.5) * strength;\n float w0 = progress;\n float w1 = 1.0 - w0;\n return mix(getFromColor(p + oc * w0), getToColor(p - oc * w1), progress);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
},
"glsl3": {
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform Common {\n float strength;\n float time;\n};\nfloat progress = time;\nin mediump vec2 v_uv0;\nin vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nvec4 transition(vec2 p) {\n vec4 ca = getFromColor(p);\n vec4 cb = getToColor(p);\n vec2 oa = (((ca.rg + ca.b) * 0.5) * 2.0 - 1.0);\n vec2 ob = (((cb.rg + cb.b) * 0.5) * 2.0 - 1.0);\n vec2 oc = mix(oa, ob, 0.5) * strength;\n float w0 = progress;\n float w1 = 1.0 - w0;\n return mix(getFromColor(p + oc * w0), getToColor(p - oc * w1), progress);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
}
}
],
"subMetas": {}
}

View File

@ -0,0 +1,17 @@
{
"__type__": "cc.Material",
"_name": "Morph",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "fde88b10-e301-436f-8d79-5093c0a12f12"
},
"_techniqueIndex": 0,
"_techniqueData": {
"0": {
"defines": {
"USE_TEXTURE": true
}
}
}
}

View File

@ -0,0 +1,6 @@
{
"ver": "1.0.3",
"uuid": "acd92272-4481-49c6-81ef-5ae28e699ecf",
"dataAsSubAsset": null,
"subMetas": {}
}

View File

@ -0,0 +1,768 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 11
},
{
"__id__": 14
},
{
"__id__": 8
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "2989fa08-f84b-4f08-83b3-a45fb8eb333c"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 512,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
},
{
"__id__": 7
},
{
"__id__": 13
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
452.93128617926146,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "75ff9DV6TxDfp7lelS5SRve",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"separator": {
"__id__": 8
},
"spriteFrame1": {
"__uuid__": "86051da6-3207-4804-9640-0e749a937e66"
},
"spriteFrame2": {
"__uuid__": "4b6b758b-cb14-48cf-8228-328c894f8ff3"
},
"bgSprite": {
"__id__": 10
},
"material": {
"__uuid__": "acd92272-4481-49c6-81ef-5ae28e699ecf"
},
"_id": "7e2sjBAfpNUZIZdLWeJ9Kv"
},
{
"__type__": "cc.Node",
"_name": "Separator",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 171,
"b": 23,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
333,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "00zwOFnw9A9Y2jJcAfpxGt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5c3bb932-6c3c-468f-88a9-c8c61d458641"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "bfovdQprtLZrbQA9328iTr"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b70P96s8FD1LitaZ7aobMA"
},
{
"__type__": "cc.Node",
"_name": "Bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
-1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "34YKVYdF5MoYlFN+Zfb6wk"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1024,
"_originalHeight": 445,
"_id": "711M5JfuBPs5F7P5bDVb/1"
},
{
"__type__": "75ff9DV6TxDfp7lelS5SRve",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"separator": {
"__id__": 8
},
"spriteFrame1": {
"__uuid__": "86051da6-3207-4804-9640-0e749a937e66"
},
"spriteFrame2": {
"__uuid__": "4b6b758b-cb14-48cf-8228-328c894f8ff3"
},
"bgSprite": {
"__id__": 10
},
"material": {
"__uuid__": "acd92272-4481-49c6-81ef-5ae28e699ecf"
},
"_id": "dePdhkKnZN/pBfcawhApa9"
},
{
"__type__": "cc.Node",
"_name": "Btn",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 15
},
{
"__id__": 17
},
{
"__id__": 18
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1477,
"height": 118
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
528.7,
0,
0,
0,
0,
1,
0.7,
0.7,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcVNNAEfFEJL7tftaCUB7n"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 16
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 14
},
"_id": "fdJg28i7pE6pi4D1ovRRp0"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "75ff9DV6TxDfp7lelS5SRve",
"handler": "switchSceneByTransition",
"customEventData": "2"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "86714285-13db-44f6-86aa-11838e0d4831"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c1sR5klVZHraEr68/UTkLE"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 17,
"_left": 0,
"_right": 0,
"_top": 180,
"_bottom": 0,
"_verticalCenter": 157.942,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "a6rm0uXY9DlbNNnoWq9hN0"
}
]

View File

@ -0,0 +1,7 @@
{
"ver": "1.2.6",
"uuid": "2989fa08-f84b-4f08-83b3-a45fb8eb333c",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@ -0,0 +1,88 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class SwitchScene extends cc.Component {
@property(cc.Node) separator = null;
@property(cc.SpriteFrame) spriteFrame1 = null;
@property(cc.SpriteFrame) spriteFrame2 = null;
@property(cc.Sprite) bgSprite = null;
@property(cc.Material) material = null;
private _spriteMaterial: cc.Material;
touchStartPos = cc.Vec2.ZERO;
separatorStartPos = cc.Vec2.ZERO;
start() {
this.bgSprite.spriteFrame.setTexture(this.spriteFrame1._texture);
this.initSpriteMaterial();
this.playTransitionAnimation();
}
onLoad() {
this.separatorStartPos = this.separator.getPosition();
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
}
switchSceneByTransition(event, value) {
cc.director.emit('setBackBtnVisibility', false);
cc.director.emit('switchSceneByTransition', value);
}
playTransitionAnimation() {
let progress = 0;
let targetProgress = cc.winSize.width;
let totalTime = 3;
let startTime = Date.now();
const loop = () => {
if (!this._spriteMaterial || !this.touchStartPos) return;
if (!this.touchStartPos.equals(cc.Vec2.ZERO)) return;
let currentTime = Date.now();
let elapsedTime = (currentTime - startTime) / 1000;
let _progress = (elapsedTime / totalTime) * targetProgress;
progress = Math.min(_progress, targetProgress);
this._spriteMaterial.setProperty('time', progress / cc.winSize.width);
this.separator.setPosition({ x: progress, y: 0 });
if (progress < targetProgress) {
requestAnimationFrame(loop.bind(this));
}
};
loop();
}
onTouchStart(event) {
this.separatorStartPos = this.separator.getPosition();
this.touchStartPos = this.node.convertToNodeSpaceAR(event.getLocation());
}
private onTouchMove(event) {
// 获取当前触摸点的位置
let touchPos = this.node.convertToNodeSpaceAR(event.getLocation());
// 计算触摸点相对于起始位置的偏移量
let offset = touchPos.sub(this.touchStartPos);
let targetPos = this.separatorStartPos.add(offset);
let targetX = Math.max(0, Math.min(targetPos.x, cc.winSize.width));
this.separator.setPosition({
x: targetX,
y: 0
});
this._spriteMaterial.setProperty('time', targetX / cc.winSize.width);
}
initSpriteMaterial() {
let newMaterial = cc.MaterialVariant.create(this.material, this.bgSprite);
newMaterial.setProperty('texture', this.spriteFrame1._texture);
newMaterial.setProperty('texture2', this.spriteFrame2._texture);
newMaterial.setProperty('time', 0.25);
this.spriteFrame1._texture.setFlipY(true);
this.spriteFrame2._texture.setFlipY(true);
this.bgSprite.setMaterial(0, newMaterial);
this._spriteMaterial = newMaterial;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "75ff90d5-e93c-437e-9ee5-7a54b9491bde",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "4c74a3e0-f277-4f9f-90c9-7dbe2f1404ee",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "629244c4-e709-4d5e-a4ac-e250b052ebe3",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg1": {
"ver": "1.0.4",
"uuid": "86051da6-3207-4804-9640-0e749a937e66",
"rawTextureUuid": "629244c4-e709-4d5e-a4ac-e250b052ebe3",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "6739472e-4b5d-4f1b-8dc1-2915cd7493d1",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg2": {
"ver": "1.0.4",
"uuid": "4b6b758b-cb14-48cf-8228-328c894f8ff3",
"rawTextureUuid": "6739472e-4b5d-4f1b-8dc1-2915cd7493d1",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "b2490222-2b5e-4601-b231-c840bffbdd5d",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1477,
"height": 118,
"platformSettings": {},
"subMetas": {
"btn": {
"ver": "1.0.4",
"uuid": "2a30f7f5-bdfb-4809-8a01-a50b2e5bee20",
"rawTextureUuid": "b2490222-2b5e-4601-b231-c840bffbdd5d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1477,
"height": 118,
"rawWidth": 1477,
"rawHeight": 118,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "a7d9aabc-6e90-4f18-b820-fec5e5691896",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "6b282196-e05b-44c8-8305-5bcbc06916fd",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,130 @@
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
CCEffect %{
techniques:
- passes:
- vert: vs
frag: fs
blendState:
targets:
- blend: true
rasterizerState:
cullMode: none
properties:
scale: { value: 20 }
smoothness: { value: 0.1 }
seed: { value: 12.9898 }
time: { value: 0 }
}%
CCProgram vs %{
precision highp float;
#include <cc-global>
#include <cc-local>
in vec3 a_position;
in vec4 a_color;
out vec4 v_color;
#if USE_TEXTURE
in vec2 a_uv0;
out vec2 v_uv0;
#endif
void main () {
vec4 pos = vec4(a_position, 1);
#if CC_USE_MODEL
pos = cc_matViewProj * cc_matWorld * pos;
#else
pos = cc_matViewProj * pos;
#endif
#if USE_TEXTURE
v_uv0 = a_uv0;
#endif
v_color = a_color;
gl_Position = pos;
}
}%
CCProgram fs %{
precision highp float;
uniform sampler2D texture;
uniform sampler2D texture2;
uniform Perlin {
float scale;
float smoothness;
float seed;
float time;
};
float progress = time;
in mediump vec2 v_uv0;
in vec4 v_color;
// http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/
float random(vec2 co) {
highp float a = seed;
highp float b = 78.233;
highp float c = 43758.5453;
highp float dt= dot(co.xy ,vec2(a,b));
highp float sn= mod(dt,3.14);
return fract(sin(sn) * c);
}
// 2D Noise based on Morgan McGuire @morgan3d
// https://www.shadertoy.com/view/4dS3Wd
float noise (in vec2 st) {
vec2 i = floor(st);
vec2 f = fract(st);
// Four corners in 2D of a tile
float a = random(i);
float b = random(i + vec2(1.0, 0.0));
float c = random(i + vec2(0.0, 1.0));
float d = random(i + vec2(1.0, 1.0));
// Cubic Hermine Curve. Same as SmoothStep
vec2 u = f*f*(3.0-2.0*f);
// Mix 4 coorners porcentages
return mix(a, b, u.x) +
(c - a)* u.y * (1.0 - u.x) +
(d - b) * u.x * u.y;
}
vec4 getFromColor(vec2 uv) {
return texture(texture, uv);
}
vec4 getToColor(vec2 uv) {
return texture(texture2, uv);
}
vec4 transition (vec2 uv) {
vec4 from = getFromColor(uv);
vec4 to = getToColor(uv);
float n = noise(uv * scale);
float p = mix(-smoothness, 1.0 + smoothness, progress);
float lower = p - smoothness;
float higher = p + smoothness;
// 根据噪声值进行平滑插值
float q = smoothstep(lower, higher, n);
return mix(
from,
to,
1.0 - q
);
}
void main () {
gl_FragColor = v_color * transition(v_uv0);
}
}%

View File

@ -0,0 +1,17 @@
{
"ver": "1.0.25",
"uuid": "3715350e-c25d-4afa-a06b-e4b480a6edef",
"compiledShaders": [
{
"glsl1": {
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform float scale;\nuniform float smoothness;\nuniform float seed;\nuniform float time;\nfloat progress = time;\nvarying mediump vec2 v_uv0;\nvarying vec4 v_color;\nfloat random(vec2 co) {\n highp float a = seed;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt= dot(co.xy ,vec2(a,b));\n highp float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\nfloat noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c = random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n vec2 u = f*f*(3.0-2.0*f);\n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\n (d - b) * u.x * u.y;\n}\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float n = noise(uv * scale);\n float p = mix(-smoothness, 1.0 + smoothness, progress);\n float lower = p - smoothness;\n float higher = p + smoothness;\n float q = smoothstep(lower, higher, n);\n return mix(\n from,\n to,\n 1.0 - q\n );\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
},
"glsl3": {
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform Perlin {\n float scale;\n float smoothness;\n float seed;\n float time;\n};\nfloat progress = time;\nin mediump vec2 v_uv0;\nin vec4 v_color;\nfloat random(vec2 co) {\n highp float a = seed;\n highp float b = 78.233;\n highp float c = 43758.5453;\n highp float dt= dot(co.xy ,vec2(a,b));\n highp float sn= mod(dt,3.14);\n return fract(sin(sn) * c);\n}\nfloat noise (in vec2 st) {\n vec2 i = floor(st);\n vec2 f = fract(st);\n float a = random(i);\n float b = random(i + vec2(1.0, 0.0));\n float c = random(i + vec2(0.0, 1.0));\n float d = random(i + vec2(1.0, 1.0));\n vec2 u = f*f*(3.0-2.0*f);\n return mix(a, b, u.x) +\n (c - a)* u.y * (1.0 - u.x) +\n (d - b) * u.x * u.y;\n}\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nvec4 transition (vec2 uv) {\n vec4 from = getFromColor(uv);\n vec4 to = getToColor(uv);\n float n = noise(uv * scale);\n float p = mix(-smoothness, 1.0 + smoothness, progress);\n float lower = p - smoothness;\n float higher = p + smoothness;\n float q = smoothstep(lower, higher, n);\n return mix(\n from,\n to,\n 1.0 - q\n );\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
}
}
],
"subMetas": {}
}

View File

@ -0,0 +1,22 @@
{
"__type__": "cc.Material",
"_name": "Perlin",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "3715350e-c25d-4afa-a06b-e4b480a6edef"
},
"_techniqueIndex": 0,
"_techniqueData": {
"0": {
"props": {
"seed": 12.9898,
"scale": 30,
"smoothness": 0.05
},
"defines": {
"USE_TEXTURE": true
}
}
}
}

View File

@ -0,0 +1,6 @@
{
"ver": "1.0.3",
"uuid": "dbf06bcd-8024-4f08-a535-08f7383edf00",
"dataAsSubAsset": null,
"subMetas": {}
}

View File

@ -0,0 +1,740 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 8
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "c255828f-28b6-421d-ab95-e56d8319a07c"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 512,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
452.93128617926146,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "f73a82LpAxBmZwDm8dJO3Q+",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"separator": {
"__id__": 8
},
"spriteFrame1": {
"__uuid__": "8ef474f4-5038-4363-8a35-cd2c2df2d8d6"
},
"spriteFrame2": {
"__uuid__": "5ff63ec2-5294-40af-9a60-4f837d09d814"
},
"bgSprite": {
"__id__": 10
},
"material": {
"__uuid__": "dbf06bcd-8024-4f08-a535-08f7383edf00"
},
"_id": "b62auiatFL/Lu4KD6wNz14"
},
{
"__type__": "cc.Node",
"_name": "Separator",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 171,
"b": 23,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
333,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "00zwOFnw9A9Y2jJcAfpxGt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5c3bb932-6c3c-468f-88a9-c8c61d458641"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "bfovdQprtLZrbQA9328iTr"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b70P96s8FD1LitaZ7aobMA"
},
{
"__type__": "cc.Node",
"_name": "Bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
-1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "34YKVYdF5MoYlFN+Zfb6wk"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1024,
"_originalHeight": 445,
"_id": "711M5JfuBPs5F7P5bDVb/1"
},
{
"__type__": "cc.Node",
"_name": "Btn",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1477,
"height": 118
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
528.7,
0,
0,
0,
0,
1,
0.7,
0.7,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcVNNAEfFEJL7tftaCUB7n"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 15
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 13
},
"_id": "fdJg28i7pE6pi4D1ovRRp0"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "f73a82LpAxBmZwDm8dJO3Q+",
"handler": "switchSceneByTransition",
"customEventData": "3"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "86714285-13db-44f6-86aa-11838e0d4831"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c1sR5klVZHraEr68/UTkLE"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 17,
"_left": 0,
"_right": 0,
"_top": 180,
"_bottom": 0,
"_verticalCenter": 157.942,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "a6rm0uXY9DlbNNnoWq9hN0"
}
]

View File

@ -0,0 +1,7 @@
{
"ver": "1.2.6",
"uuid": "c255828f-28b6-421d-ab95-e56d8319a07c",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@ -0,0 +1,88 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class SwitchScene extends cc.Component {
@property(cc.Node) separator = null;
@property(cc.SpriteFrame) spriteFrame1 = null;
@property(cc.SpriteFrame) spriteFrame2 = null;
@property(cc.Sprite) bgSprite = null;
@property(cc.Material) material = null;
private _spriteMaterial: cc.Material;
touchStartPos = cc.Vec2.ZERO;
separatorStartPos = cc.Vec2.ZERO;
start() {
this.bgSprite.spriteFrame.setTexture(this.spriteFrame1._texture);
this.initSpriteMaterial();
this.playTransitionAnimation();
}
onLoad() {
this.separatorStartPos = this.separator.getPosition();
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
}
switchSceneByTransition(event, value) {
cc.director.emit('setBackBtnVisibility', false);
cc.director.emit('switchSceneByTransition', value);
}
playTransitionAnimation() {
let progress = 0;
let targetProgress = cc.winSize.width;
let totalTime = 3;
let startTime = Date.now();
const loop = () => {
if (!this._spriteMaterial || !this.touchStartPos) return;
if (!this.touchStartPos.equals(cc.Vec2.ZERO)) return;
let currentTime = Date.now();
let elapsedTime = (currentTime - startTime) / 1000;
let _progress = (elapsedTime / totalTime) * targetProgress;
progress = Math.min(_progress, targetProgress);
this._spriteMaterial.setProperty('time', progress / cc.winSize.width);
this.separator.setPosition({ x: progress, y: 0 });
if (progress < targetProgress) {
requestAnimationFrame(loop.bind(this));
}
};
loop();
}
onTouchStart(event) {
this.separatorStartPos = this.separator.getPosition();
this.touchStartPos = this.node.convertToNodeSpaceAR(event.getLocation());
}
private onTouchMove(event) {
// 获取当前触摸点的位置
let touchPos = this.node.convertToNodeSpaceAR(event.getLocation());
// 计算触摸点相对于起始位置的偏移量
let offset = touchPos.sub(this.touchStartPos);
let targetPos = this.separatorStartPos.add(offset);
let targetX = Math.max(0, Math.min(targetPos.x, cc.winSize.width));
this.separator.setPosition({
x: targetX,
y: 0
});
this._spriteMaterial.setProperty('time', targetX / cc.winSize.width);
}
initSpriteMaterial() {
let newMaterial = cc.MaterialVariant.create(this.material, this.bgSprite);
newMaterial.setProperty('texture', this.spriteFrame1._texture);
newMaterial.setProperty('texture2', this.spriteFrame2._texture);
newMaterial.setProperty('time', 0.25);
this.spriteFrame1._texture.setFlipY(true);
this.spriteFrame2._texture.setFlipY(true);
this.bgSprite.setMaterial(0, newMaterial);
this._spriteMaterial = newMaterial;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "f73a8d8b-a40c-4199-9c03-9bc7493b743e",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "2ed3b822-f01e-4df0-b9b7-9913abcd8a74",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "7f5e5fa1-b48c-44e3-80f4-324d5286ac51",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg1": {
"ver": "1.0.4",
"uuid": "8ef474f4-5038-4363-8a35-cd2c2df2d8d6",
"rawTextureUuid": "7f5e5fa1-b48c-44e3-80f4-324d5286ac51",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "ce5595f3-8df9-478a-9e41-4a165be77c71",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg2": {
"ver": "1.0.4",
"uuid": "5ff63ec2-5294-40af-9a60-4f837d09d814",
"rawTextureUuid": "ce5595f3-8df9-478a-9e41-4a165be77c71",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "7ef0dd99-bd4e-425f-ae16-e42c6f2c0a0b",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1477,
"height": 118,
"platformSettings": {},
"subMetas": {
"btn": {
"ver": "1.0.4",
"uuid": "2e5c2eba-5763-4675-9977-569657fff94e",
"rawTextureUuid": "7ef0dd99-bd4e-425f-ae16-e42c6f2c0a0b",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1477,
"height": 118,
"rawWidth": 1477,
"rawHeight": 118,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "5f5f749c-61be-48c1-b0fc-1a4df10190e9",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "274be50a-f5d7-4f56-a5db-a22261a4fa80",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,89 @@
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
CCEffect %{
techniques:
- passes:
- vert: vs
frag: fs
blendState:
targets:
- blend: true
rasterizerState:
cullMode: none
properties:
texture: { value: white }
dots: {value: 80.0}
center: {value: [0, 1]}
time: {value: 0}
}%
CCProgram vs %{
precision highp float;
#include <cc-global>
#include <cc-local>
in vec3 a_position;
in vec4 a_color;
out vec4 v_color;
#if USE_TEXTURE
in vec2 a_uv0;
out vec2 v_uv0;
#endif
void main () {
vec4 pos = vec4(a_position, 1);
#if CC_USE_MODEL
pos = cc_matViewProj * cc_matWorld * pos;
#else
pos = cc_matViewProj * pos;
#endif
#if USE_TEXTURE
v_uv0 = a_uv0;
#endif
v_color = a_color;
gl_Position = pos;
}
}%
CCProgram fs %{
precision highp float;
uniform sampler2D texture;
uniform sampler2D texture2;
uniform Common {
vec2 center;
float dots;
float time;
};
float progress = time;
in mediump vec2 v_uv0;
in vec4 v_color;
vec4 getFromColor(vec2 uv) {
return texture(texture, uv);
}
vec4 getToColor(vec2 uv) {
return texture(texture2, uv);
}
vec4 transition(vec2 uv) {
// 计算当前UV坐标点到图像中心点的距离
float distanceToCenter = distance(uv, center);
// 计算UV坐标点映射到dots纹理中的位置并计算该位置与纹理中心点的距离
float distanceToDotsCenter = distance(fract(uv * dots), vec2(0.5, 0.5));
// 比较UV坐标点到纹理中心点的距离与进度的比值如果比值小于等于progress
// 并且distanceToDotsCenter小于distanceToCenter则认为需要切换到下一张图像
bool nextImage = distanceToDotsCenter < (progress / distanceToCenter);
return nextImage ? getToColor(uv) : getFromColor(uv);
}
void main () {
gl_FragColor = v_color * transition(v_uv0);
}
}%

View File

@ -0,0 +1,17 @@
{
"ver": "1.0.25",
"uuid": "b805e327-099f-4cb8-a66b-ebca7c96c0e7",
"compiledShaders": [
{
"glsl1": {
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nuniform mat4 cc_matWorld;\nattribute vec3 a_position;\nattribute vec4 a_color;\nvarying vec4 v_color;\n#if USE_TEXTURE\nattribute vec2 a_uv0;\nvarying vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform vec2 center;\nuniform float dots;\nuniform float time;\nfloat progress = time;\nvarying mediump vec2 v_uv0;\nvarying vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture2D(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture2D(texture2, uv);\n}\nvec4 transition(vec2 uv) {\n float distanceToCenter = distance(uv, center);\n float distanceToDotsCenter = distance(fract(uv * dots), vec2(0.5, 0.5));\n bool nextImage = distanceToDotsCenter < (progress / distanceToCenter);\n return nextImage ? getToColor(uv) : getFromColor(uv);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
},
"glsl3": {
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin vec4 a_color;\nout vec4 v_color;\n#if USE_TEXTURE\nin vec2 a_uv0;\nout vec2 v_uv0;\n#endif\nvoid main () {\n vec4 pos = vec4(a_position, 1);\n #if CC_USE_MODEL\n pos = cc_matViewProj * cc_matWorld * pos;\n #else\n pos = cc_matViewProj * pos;\n #endif\n #if USE_TEXTURE\n v_uv0 = a_uv0;\n #endif\n v_color = a_color;\n gl_Position = pos;\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nuniform Common {\n vec2 center;\n float dots;\n float time;\n};\nfloat progress = time;\nin mediump vec2 v_uv0;\nin vec4 v_color;\nvec4 getFromColor(vec2 uv) {\n return texture(texture, uv);\n}\nvec4 getToColor(vec2 uv) {\n return texture(texture2, uv);\n}\nvec4 transition(vec2 uv) {\n float distanceToCenter = distance(uv, center);\n float distanceToDotsCenter = distance(fract(uv * dots), vec2(0.5, 0.5));\n bool nextImage = distanceToDotsCenter < (progress / distanceToCenter);\n return nextImage ? getToColor(uv) : getFromColor(uv);\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
}
}
],
"subMetas": {}
}

View File

@ -0,0 +1,25 @@
{
"__type__": "cc.Material",
"_name": "PolkaDotsCurtain",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "b805e327-099f-4cb8-a66b-ebca7c96c0e7"
},
"_techniqueIndex": 0,
"_techniqueData": {
"0": {
"defines": {
"USE_TEXTURE": true
},
"props": {
"center": {
"__type__": "cc.Vec2",
"x": 0,
"y": 1
},
"dots": 80
}
}
}
}

View File

@ -0,0 +1,6 @@
{
"ver": "1.0.3",
"uuid": "985a2d90-fd09-4d07-9d94-a50d5af116d9",
"dataAsSubAsset": null,
"subMetas": {}
}

View File

@ -0,0 +1,740 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 8
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "582e4910-11a1-4f5c-9441-aa319156d8c4"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 512,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
452.93128617926146,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "0445dlJQ9tLR7xapzM+CJSX",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"separator": {
"__id__": 8
},
"spriteFrame1": {
"__uuid__": "40bfcf63-95f8-4023-9b53-f46addfc260c"
},
"spriteFrame2": {
"__uuid__": "d459a6d4-cd68-474a-bc44-33996165b2e7"
},
"bgSprite": {
"__id__": 10
},
"material": {
"__uuid__": "985a2d90-fd09-4d07-9d94-a50d5af116d9"
},
"_id": "ddjmI/yPpFzIp77M2Qbh6p"
},
{
"__type__": "cc.Node",
"_name": "Separator",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 171,
"b": 23,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
333,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "00zwOFnw9A9Y2jJcAfpxGt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5c3bb932-6c3c-468f-88a9-c8c61d458641"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "bfovdQprtLZrbQA9328iTr"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b70P96s8FD1LitaZ7aobMA"
},
{
"__type__": "cc.Node",
"_name": "Bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
-1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "34YKVYdF5MoYlFN+Zfb6wk"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1024,
"_originalHeight": 445,
"_id": "711M5JfuBPs5F7P5bDVb/1"
},
{
"__type__": "cc.Node",
"_name": "Btn",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1477,
"height": 118
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
528.7,
0,
0,
0,
0,
1,
0.7,
0.7,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcVNNAEfFEJL7tftaCUB7n"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 15
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 13
},
"_id": "fdJg28i7pE6pi4D1ovRRp0"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "0445dlJQ9tLR7xapzM+CJSX",
"handler": "switchSceneByTransition",
"customEventData": "4"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "86714285-13db-44f6-86aa-11838e0d4831"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c1sR5klVZHraEr68/UTkLE"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 17,
"_left": 0,
"_right": 0,
"_top": 180,
"_bottom": 0,
"_verticalCenter": 157.942,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "a6rm0uXY9DlbNNnoWq9hN0"
}
]

View File

@ -0,0 +1,7 @@
{
"ver": "1.2.6",
"uuid": "582e4910-11a1-4f5c-9441-aa319156d8c4",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

View File

@ -0,0 +1,88 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class SwitchScene extends cc.Component {
@property(cc.Node) separator = null;
@property(cc.SpriteFrame) spriteFrame1 = null;
@property(cc.SpriteFrame) spriteFrame2 = null;
@property(cc.Sprite) bgSprite = null;
@property(cc.Material) material = null;
private _spriteMaterial: cc.Material;
touchStartPos = cc.Vec2.ZERO;
separatorStartPos = cc.Vec2.ZERO;
start() {
this.bgSprite.spriteFrame.setTexture(this.spriteFrame1._texture);
this.initSpriteMaterial();
this.playTransitionAnimation();
}
onLoad() {
this.separatorStartPos = this.separator.getPosition();
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
}
switchSceneByTransition(event, value) {
cc.director.emit('setBackBtnVisibility', false);
cc.director.emit('switchSceneByTransition', value);
}
playTransitionAnimation() {
let progress = 0;
let targetProgress = cc.winSize.width;
let totalTime = 3;
let startTime = Date.now();
const loop = () => {
if (!this._spriteMaterial || !this.touchStartPos) return;
if (!this.touchStartPos.equals(cc.Vec2.ZERO)) return;
let currentTime = Date.now();
let elapsedTime = (currentTime - startTime) / 1000;
let _progress = (elapsedTime / totalTime) * targetProgress;
progress = Math.min(_progress, targetProgress);
this._spriteMaterial.setProperty('time', progress / cc.winSize.width);
this.separator.setPosition({ x: progress, y: 0 });
if (progress < targetProgress) {
requestAnimationFrame(loop.bind(this));
}
};
loop();
}
onTouchStart(event) {
this.separatorStartPos = this.separator.getPosition();
this.touchStartPos = this.node.convertToNodeSpaceAR(event.getLocation());
}
private onTouchMove(event) {
// 获取当前触摸点的位置
let touchPos = this.node.convertToNodeSpaceAR(event.getLocation());
// 计算触摸点相对于起始位置的偏移量
let offset = touchPos.sub(this.touchStartPos);
let targetPos = this.separatorStartPos.add(offset);
let targetX = Math.max(0, Math.min(targetPos.x, cc.winSize.width));
this.separator.setPosition({
x: targetX,
y: 0
});
this._spriteMaterial.setProperty('time', targetX / cc.winSize.width);
}
initSpriteMaterial() {
let newMaterial = cc.MaterialVariant.create(this.material, this.bgSprite);
newMaterial.setProperty('texture', this.spriteFrame1._texture);
newMaterial.setProperty('texture2', this.spriteFrame2._texture);
newMaterial.setProperty('time', 0.25);
this.spriteFrame1._texture.setFlipY(true);
this.spriteFrame2._texture.setFlipY(true);
this.bgSprite.setMaterial(0, newMaterial);
this._spriteMaterial = newMaterial;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "0445d949-43db-4b47-bc5a-a7333e089497",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "4c24576e-d3fd-45f9-ab3c-90b5dd2af491",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "7b3ab555-1089-4fd4-9d54-7c8106aaf851",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg1": {
"ver": "1.0.4",
"uuid": "40bfcf63-95f8-4023-9b53-f46addfc260c",
"rawTextureUuid": "7b3ab555-1089-4fd4-9d54-7c8106aaf851",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "fe4f9866-9815-41fe-b68f-db9ece82bd26",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1600,
"height": 1200,
"platformSettings": {},
"subMetas": {
"bg2": {
"ver": "1.0.4",
"uuid": "d459a6d4-cd68-474a-bc44-33996165b2e7",
"rawTextureUuid": "fe4f9866-9815-41fe-b68f-db9ece82bd26",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1600,
"height": 1200,
"rawWidth": 1600,
"rawHeight": 1200,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,36 @@
{
"ver": "2.3.4",
"uuid": "e94e39b2-ce34-4776-9419-4d2a7a6f1774",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1477,
"height": 118,
"platformSettings": {},
"subMetas": {
"btn": {
"ver": "1.0.4",
"uuid": "b2e58877-f147-40cc-bf19-b5eed5bb9590",
"rawTextureUuid": "e94e39b2-ce34-4776-9419-4d2a7a6f1774",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1477,
"height": 118,
"rawWidth": 1477,
"rawHeight": 118,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -180,7 +180,7 @@
"array": [ "array": [
0, 0,
0, 0,
769.0305585605815, 452.93128617926146,
0, 0,
0, 0,
0, 0,
@ -284,7 +284,7 @@
"_id": "29zXboiXFBKoIV4PQ2liTe" "_id": "29zXboiXFBKoIV4PQ2liTe"
}, },
{ {
"__type__": "d3f4aqDF35LMbT4FoeX+msm", "__type__": "9a422OgmqtKVbOR0Q+NC+Bk",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
@ -306,7 +306,7 @@
"material": { "material": {
"__uuid__": "a869ac13-ffed-4334-b5df-1251273f2b07" "__uuid__": "a869ac13-ffed-4334-b5df-1251273f2b07"
}, },
"_id": "baVBIwAahNp5q/xqS/DqnM" "_id": "d3mJxgwgVFOaVDy9/WXkqz"
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
@ -674,9 +674,9 @@
"__id__": 2 "__id__": 2
}, },
"component": "", "component": "",
"_componentId": "d3f4aqDF35LMbT4FoeX+msm", "_componentId": "9a422OgmqtKVbOR0Q+NC+Bk",
"handler": "switchSceneByTransition", "handler": "switchSceneByTransition",
"customEventData": "" "customEventData": "5"
}, },
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",

View File

@ -0,0 +1,88 @@
const { ccclass, property } = cc._decorator;
@ccclass
export default class SwitchScene extends cc.Component {
@property(cc.Node) separator = null;
@property(cc.SpriteFrame) spriteFrame1 = null;
@property(cc.SpriteFrame) spriteFrame2 = null;
@property(cc.Sprite) bgSprite = null;
@property(cc.Material) material = null;
private _spriteMaterial: cc.Material;
touchStartPos = cc.Vec2.ZERO;
separatorStartPos = cc.Vec2.ZERO;
start() {
this.bgSprite.spriteFrame.setTexture(this.spriteFrame1._texture);
this.initSpriteMaterial();
this.playTransitionAnimation();
}
onLoad() {
this.separatorStartPos = this.separator.getPosition();
this.node.on(cc.Node.EventType.TOUCH_START, this.onTouchStart, this);
this.node.on(cc.Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
}
switchSceneByTransition(event, value) {
cc.director.emit('setBackBtnVisibility', false);
cc.director.emit('switchSceneByTransition', value);
}
playTransitionAnimation() {
let progress = 0;
let targetProgress = cc.winSize.width;
let totalTime = 3;
let startTime = Date.now();
const loop = () => {
if (!this._spriteMaterial || !this.touchStartPos) return;
if (!this.touchStartPos.equals(cc.Vec2.ZERO)) return;
let currentTime = Date.now();
let elapsedTime = (currentTime - startTime) / 1000;
let _progress = (elapsedTime / totalTime) * targetProgress;
progress = Math.min(_progress, targetProgress);
this._spriteMaterial.setProperty('time', progress / cc.winSize.width);
this.separator.setPosition({ x: progress, y: 0 });
if (progress < targetProgress) {
requestAnimationFrame(loop.bind(this));
}
};
loop();
}
onTouchStart(event) {
this.separatorStartPos = this.separator.getPosition();
this.touchStartPos = this.node.convertToNodeSpaceAR(event.getLocation());
}
private onTouchMove(event) {
// 获取当前触摸点的位置
let touchPos = this.node.convertToNodeSpaceAR(event.getLocation());
// 计算触摸点相对于起始位置的偏移量
let offset = touchPos.sub(this.touchStartPos);
let targetPos = this.separatorStartPos.add(offset);
let targetX = Math.max(0, Math.min(targetPos.x, cc.winSize.width));
this.separator.setPosition({
x: targetX,
y: 0
});
this._spriteMaterial.setProperty('time', targetX / cc.winSize.width);
}
initSpriteMaterial() {
let newMaterial = cc.MaterialVariant.create(this.material, this.bgSprite);
newMaterial.setProperty('texture', this.spriteFrame1._texture);
newMaterial.setProperty('texture2', this.spriteFrame2._texture);
newMaterial.setProperty('time', 0.25);
this.spriteFrame1._texture.setFlipY(true);
this.spriteFrame2._texture.setFlipY(true);
this.bgSprite.setMaterial(0, newMaterial);
this._spriteMaterial = newMaterial;
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.0.5",
"uuid": "9a4223a0-9aab-4a55-b391-d10f8d0be064",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "912fa62d-24ff-43c2-bf85-e20e958aef64",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,7 @@
{
"ver": "1.0.1",
"uuid": "262f1940-d016-4f77-be84-7327c6b4596b",
"isSubpackage": false,
"subpackageName": "",
"subMetas": {}
}

View File

@ -0,0 +1,22 @@
{
"__type__": "cc.Material",
"_name": "strip-lt",
"_objFlags": 0,
"_native": "",
"_effectAsset": {
"__uuid__": "6b233ee2-ef6d-4ee5-9b24-999badfcff68"
},
"_techniqueIndex": 0,
"_techniqueData": {
"0": {
"props": {
"direction": {
"__type__": "cc.Vec2",
"x": -1,
"y": 1
}
},
"defines": {}
}
}
}

View File

@ -0,0 +1,6 @@
{
"ver": "1.0.3",
"uuid": "ee73e8c0-5ff0-486a-bcdf-dec85b04755b",
"dataAsSubAsset": null,
"subMetas": {}
}

View File

@ -0,0 +1,140 @@
// Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
CCEffect %{
techniques:
- passes:
- vert: vs
frag: fs
blendState:
targets:
- blend: true
rasterizerState:
cullMode: none
properties:
texture: { value: white }
texture2: { value: white }
time: { value: 0 }
direction: { value: [1, 1]}
}%
CCProgram transition %{
// https://www.shadertoy.com/view/ls3cDB
const float PI = 3.141592653589793;
const float PI_2 = 3.141592653589793;
#define radius .1
uniform Transition {
vec2 direction; // = [1, 1]
};
float aspect = 1.;//screenSize.x / screenSize.y;
vec4 iMouse = vec4(
screenSize.x * (mod((1.0 + time * direction.x), 1.0) + 0.2 * sign(direction.x)),
screenSize.y * (mod((1.0 + time * direction.y), 1.0) + 0.2 * sign(direction.y)),
screenSize.x * (1.0 - step(0.0, direction.x)),
screenSize.y * (1.0 - step(0.0, direction.y))
);
vec2 mouse = iMouse.xy * vec2(aspect, 1.) / screenSize.xy;
vec2 mouseDir = normalize(abs(iMouse.zw) - iMouse.xy);
vec4 transition(vec2 uv) {
// vec2 uv = fragCoord * vec2(aspect, 1.) / screenSize.xy;
float dist = dot(uv - mouse, mouseDir);
vec2 linePoint = uv - dist * mouseDir;
vec4 fragColor = vec4(1.0);
if (dist > radius) {
fragColor = texture(texture2, uv);
// add shadow
// fragColor.rgb *= pow(clamp(dist - radius, 0., 1.) * 1.5, .2);
}
else if (dist >= 0.) {
// map to cylinder point
float theta = asin(dist / radius);
vec2 p2 = linePoint + mouseDir * (PI - theta) * radius;
vec2 p1 = linePoint + mouseDir * theta * radius;
uv = (p2.x <= aspect && p2.y <= 1. && p2.x > 0. && p2.y > 0.) ? p2 : p1;
fragColor = texture(texture, uv);
fragColor.rgb *= pow(clamp((radius - dist) / radius, 0., 1.), .2);
}
else {
vec2 p = linePoint + mouseDir * (abs(dist) + PI * radius);
uv = (p.x <= aspect && p.y <= 1. && p.x > 0. && p.y > 0.) ? p : uv;
fragColor = texture(texture, uv);
}
return fragColor;
}
}%
CCProgram vs %{
precision highp float;
#include <cc-global>
#include <cc-local>
in vec3 a_position;
in lowp vec4 a_color;
in mediump vec2 a_uv0;
out mediump vec2 v_uv0;
out lowp vec4 v_color;
uniform Time {
vec2 screenSize;
float time;
};
void main() {
mat4 mvp;
mvp = cc_matViewProj;
v_uv0 = a_uv0;
v_color = a_color;
gl_Position = mvp * vec4(a_position, 1);
}
}%
CCProgram fs %{
precision highp float;
uniform sampler2D texture;
uniform sampler2D texture2;
in mediump vec2 v_uv0;
uniform Time {
vec2 screenSize;
float time;
};
in lowp vec4 v_color;
vec4 getFromColor(vec2 uv) {
return texture(texture, uv);
}
vec4 getToColor(vec2 uv) {
return texture(texture2, uv);
}
#include <transition>
void main () {
gl_FragColor = v_color * transition(v_uv0);
}
}%

View File

@ -0,0 +1,17 @@
{
"ver": "1.0.25",
"uuid": "6b233ee2-ef6d-4ee5-9b24-999badfcff68",
"compiledShaders": [
{
"glsl1": {
"vert": "\nprecision highp float;\nuniform mediump mat4 cc_matViewProj;\nattribute vec3 a_position;\nattribute lowp vec4 a_color;\nattribute mediump vec2 a_uv0;\nvarying mediump vec2 v_uv0;\nvarying lowp vec4 v_color;\nvoid main() {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nvarying mediump vec2 v_uv0;\nuniform vec2 screenSize;\nuniform float time;\nvarying lowp vec4 v_color;\nconst float PI = 3.141592653589793;\nconst float PI_2 = 3.141592653589793;\nuniform vec2 direction;\nfloat aspect = 1.;\nvec4 iMouse = vec4(\n screenSize.x * (mod((1.0 + time * direction.x), 1.0) + 0.2 * sign(direction.x)),\n screenSize.y * (mod((1.0 + time * direction.y), 1.0) + 0.2 * sign(direction.y)),\n screenSize.x * (1.0 - step(0.0, direction.x)),\n screenSize.y * (1.0 - step(0.0, direction.y))\n);\nvec2 mouse = iMouse.xy * vec2(aspect, 1.) / screenSize.xy;\nvec2 mouseDir = normalize(abs(iMouse.zw) - iMouse.xy);\nvec4 transition(vec2 uv) {\n float dist = dot(uv - mouse, mouseDir);\n vec2 linePoint = uv - dist * mouseDir;\n vec4 fragColor = vec4(1.0);\n if (dist > .1) {\n fragColor = texture2D(texture2, uv);\n }\n else if (dist >= 0.) {\n float theta = asin(dist / .1);\n vec2 p2 = linePoint + mouseDir * (PI - theta) * .1;\n vec2 p1 = linePoint + mouseDir * theta * .1;\n uv = (p2.x <= aspect && p2.y <= 1. && p2.x > 0. && p2.y > 0.) ? p2 : p1;\n fragColor = texture2D(texture, uv);\n fragColor.rgb *= pow(clamp((.1 - dist) / .1, 0., 1.), .2);\n }\n else {\n vec2 p = linePoint + mouseDir * (abs(dist) + PI * .1);\n uv = (p.x <= aspect && p.y <= 1. && p.x > 0. && p.y > 0.) ? p : uv;\n fragColor = texture2D(texture, uv);\n }\n return fragColor;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
},
"glsl3": {
"vert": "\nprecision highp float;\nuniform CCGlobal {\n highp vec4 cc_time;\n mediump vec4 cc_screenSize;\n mediump vec4 cc_screenScale;\n mediump vec4 cc_nativeSize;\n highp mat4 cc_matView;\n mediump mat4 cc_matViewInv;\n mediump mat4 cc_matProj;\n mediump mat4 cc_matProjInv;\n mediump mat4 cc_matViewProj;\n mediump mat4 cc_matViewProjInv;\n mediump vec4 cc_cameraPos;\n};\nuniform CCLocal {\n mat4 cc_matWorld;\n mat4 cc_matWorldIT;\n};\nin vec3 a_position;\nin lowp vec4 a_color;\nin mediump vec2 a_uv0;\nout mediump vec2 v_uv0;\nout lowp vec4 v_color;\nuniform Time {\n vec2 screenSize;\n float time;\n};\nvoid main() {\n mat4 mvp;\n mvp = cc_matViewProj;\n v_uv0 = a_uv0;\n v_color = a_color;\n gl_Position = mvp * vec4(a_position, 1);\n}",
"frag": "\nprecision highp float;\nuniform sampler2D texture;\nuniform sampler2D texture2;\nin mediump vec2 v_uv0;\nuniform Time {\n vec2 screenSize;\n float time;\n};\nin lowp vec4 v_color;\nconst float PI = 3.141592653589793;\nconst float PI_2 = 3.141592653589793;\nuniform Transition {\n vec2 direction;\n};\nfloat aspect = 1.;\nvec4 iMouse = vec4(\n screenSize.x * (mod((1.0 + time * direction.x), 1.0) + 0.2 * sign(direction.x)),\n screenSize.y * (mod((1.0 + time * direction.y), 1.0) + 0.2 * sign(direction.y)),\n screenSize.x * (1.0 - step(0.0, direction.x)),\n screenSize.y * (1.0 - step(0.0, direction.y))\n);\nvec2 mouse = iMouse.xy * vec2(aspect, 1.) / screenSize.xy;\nvec2 mouseDir = normalize(abs(iMouse.zw) - iMouse.xy);\nvec4 transition(vec2 uv) {\n float dist = dot(uv - mouse, mouseDir);\n vec2 linePoint = uv - dist * mouseDir;\n vec4 fragColor = vec4(1.0);\n if (dist > .1) {\n fragColor = texture(texture2, uv);\n }\n else if (dist >= 0.) {\n float theta = asin(dist / .1);\n vec2 p2 = linePoint + mouseDir * (PI - theta) * .1;\n vec2 p1 = linePoint + mouseDir * theta * .1;\n uv = (p2.x <= aspect && p2.y <= 1. && p2.x > 0. && p2.y > 0.) ? p2 : p1;\n fragColor = texture(texture, uv);\n fragColor.rgb *= pow(clamp((.1 - dist) / .1, 0., 1.), .2);\n }\n else {\n vec2 p = linePoint + mouseDir * (abs(dist) + PI * .1);\n uv = (p.x <= aspect && p.y <= 1. && p.x > 0. && p.y > 0.) ? p : uv;\n fragColor = texture(texture, uv);\n }\n return fragColor;\n}\nvoid main () {\n gl_FragColor = v_color * transition(v_uv0);\n}"
}
}
],
"subMetas": {}
}

View File

@ -0,0 +1,740 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "",
"_objFlags": 0,
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_objFlags": 0,
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 11
},
{
"__id__": 13
},
{
"__id__": 8
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_is3DNode": true,
"_groupIndex": 0,
"groupIndex": 0,
"autoReleaseAssets": false,
"_id": "17ca8f16-26d6-4862-90da-cb338d55f704"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 512,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_components": [
{
"__id__": 5
},
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "a5esZu+45LA5mBpvttspPD"
},
{
"__type__": "cc.Node",
"_name": "Main Camera",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 960,
"height": 640
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
452.93128617926146,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "e1WoFrQ79G7r4ZuQE3HlNb"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_cullingMask": 4294967295,
"_clearFlags": 7,
"_backgroundColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": -1,
"_zoomRatio": 1,
"_targetTexture": null,
"_fov": 60,
"_orthoSize": 10,
"_nearClip": 1,
"_farClip": 4096,
"_ortho": true,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_renderStages": 1,
"_alignWithScreen": true,
"_id": "81GN3uXINKVLeW4+iKSlim"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_designResolution": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_fitWidth": false,
"_fitHeight": true,
"_id": "59Cd0ovbdF4byw5sbjJDx7"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "29zXboiXFBKoIV4PQ2liTe"
},
{
"__type__": "22c8cP1MQNB7Ka1h8g/gS0z",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"separator": {
"__id__": 8
},
"spriteFrame1": {
"__uuid__": "fadd364e-5cc6-4fe1-a458-93dc172c36af"
},
"spriteFrame2": {
"__uuid__": "24e8b90f-3d1d-4078-90fa-567b5d3a78a8"
},
"bgSprite": {
"__id__": 10
},
"material": {
"__uuid__": "ee73e8c0-5ff0-486a-bcdf-dec85b04755b"
},
"_id": "02KUZjxDBPoIDETyoLgMk8"
},
{
"__type__": "cc.Node",
"_name": "Separator",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 171,
"b": 23,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 10,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
333,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "00zwOFnw9A9Y2jJcAfpxGt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "5c3bb932-6c3c-468f-88a9-c8c61d458641"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "bfovdQprtLZrbQA9328iTr"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b70P96s8FD1LitaZ7aobMA"
},
{
"__type__": "cc.Node",
"_name": "Bg",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
375,
0,
0,
0,
0,
1,
1,
-1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "34YKVYdF5MoYlFN+Zfb6wk"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1024,
"_originalHeight": 445,
"_id": "711M5JfuBPs5F7P5bDVb/1"
},
{
"__type__": "cc.Node",
"_name": "Btn",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 14
},
{
"__id__": 16
},
{
"__id__": 17
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1477,
"height": 118
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
667,
528.7,
0,
0,
0,
0,
1,
0.7,
0.7,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "bcVNNAEfFEJL7tftaCUB7n"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 15
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 13
},
"_id": "fdJg28i7pE6pi4D1ovRRp0"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "22c8cP1MQNB7Ka1h8g/gS0z",
"handler": "switchSceneByTransition",
"customEventData": "6"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "86714285-13db-44f6-86aa-11838e0d4831"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "c1sR5klVZHraEr68/UTkLE"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 13
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 17,
"_left": 0,
"_right": 0,
"_top": 180,
"_bottom": 0,
"_verticalCenter": 157.942,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "a6rm0uXY9DlbNNnoWq9hN0"
}
]

View File

@ -0,0 +1,7 @@
{
"ver": "1.2.6",
"uuid": "17ca8f16-26d6-4862-90da-cb338d55f704",
"asyncLoadAssets": false,
"autoReleaseAssets": false,
"subMetas": {}
}

Some files were not shown because too many files have changed in this diff Show More