Commit ce7f48c3 authored by 范雪寒's avatar 范雪寒

feat: 点击按钮后蒙层

parent a00a6b76
......@@ -299,15 +299,18 @@
},
{
"__id__": 112
},
{
"__id__": 147
}
],
"_active": true,
"_components": [
{
"__id__": 147
"__id__": 151
},
{
"__id__": 148
"__id__": 152
}
],
"_prefab": null,
......@@ -460,7 +463,7 @@
"__id__": 7
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 11
......@@ -655,7 +658,7 @@
"__id__": 7
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 15
......@@ -850,7 +853,7 @@
"__id__": 7
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 19
......@@ -6989,6 +6992,201 @@
"_originalHeight": 0,
"_id": "65n6SW1qBD6LRC6plYtLl8"
},
{
"__type__": "cc.Node",
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 148
},
{
"__id__": 149
},
{
"__id__": 150
}
],
"_prefab": null,
"_opacity": 0,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
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": "99Dj7SSYxItKIgEY1N79mA"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 147
},
"_enabled": true,
"alignMode": 2,
"_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": "c6QYh6a3xJgq40gtvV2x7F"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 147
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_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": null,
"_id": "97JBLAzUJEa70YQRzWLGBS"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 147
},
"_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": "a8DKzGuzZEFJXL6eBHARw0"
},
{
"__type__": "cc.Widget",
"_name": "",
......
......@@ -213,8 +213,8 @@ cc.Class({
cc.find('middleLayer/BtnLeft').active = false;
cc.tween(exitBtn)
.to(0.1, { scaleX: 0.9, scaleY: 1.1 })
.to(0.1, { scaleX: 1.1, scaleY: 0.9 })
.to(0.1, { scaleX: 0.4, scaleY: 0.6 })
.to(0.1, { scaleX: 0.6, scaleY: 0.4 })
.to(0.1, { scaleX: 1, scaleY: 1 })
.call(() => {
exitBtn.active = false;
......@@ -223,6 +223,7 @@ cc.Class({
cc.audioEngine.stopAll();
window.courseware.freeAllOcMethod();
cc.director.loadScene("debug_shell", null, null, (err, scene) => {
});
})
.start();
......@@ -430,6 +431,7 @@ cc.Class({
this.loadBundle(sceneName, version, bondleUrl);
},
loadBundle(sceneName, version, bondleUrl) {
this.showMask();
cc.assetManager.loadBundle(bondleUrl, { version: version }, async (err, bundle) => {
if (err) {
return this.asyncDelayLog(err);
......@@ -440,6 +442,7 @@ cc.Class({
}
cc.audioEngine.stopAll();
cc.director.runScene(scene, null, () => {
this.hideMask();
console.log('sceneName = ' + sceneName);
const Canvas = cc.find('Canvas');
const middleLayer = cc.find('middleLayer');
......@@ -453,6 +456,22 @@ cc.Class({
});
},
showMask() {
const mask = cc.find('middleLayer/mask');
cc.tween(mask)
.set({ active: true, opacity: 0 })
.to(1, { opacity: 255 })
.start();
},
hideMask() {
const mask = cc.find('middleLayer/mask');
cc.tween(mask)
.to(1, { opacity: 0 })
.set({ active: true })
.start();
},
reWriteAir() {
window.courseware.getData = (callback) => {
let data = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment