Commit 5639f131 authored by Lwd's avatar Lwd

aaaa

parent f90c8d88
...@@ -75,22 +75,22 @@ ...@@ -75,22 +75,22 @@
"__id__": 5 "__id__": 5
}, },
{ {
"__id__": 182 "__id__": 184
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 184 "__id__": 186
}, },
{ {
"__id__": 185 "__id__": 187
}, },
{ {
"__id__": 186 "__id__": 188
}, },
{ {
"__id__": 187 "__id__": 189
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -252,6 +252,9 @@ ...@@ -252,6 +252,9 @@
}, },
{ {
"__id__": 8 "__id__": 8
},
{
"__id__": 182
} }
], ],
"_active": true, "_active": true,
...@@ -2989,8 +2992,8 @@ ...@@ -2989,8 +2992,8 @@
0, 0,
0, 0,
1, 1,
0.8, 0.5,
0.8, 0.5,
1 1
] ]
}, },
...@@ -7805,6 +7808,78 @@ ...@@ -7805,6 +7808,78 @@
"fileId": "", "fileId": "",
"sync": false "sync": false
}, },
{
"__type__": "cc.Node",
"_name": "mask",
"_objFlags": 0,
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 183
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 5000,
"height": 5000
},
"_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": "c2bmd0u+BDNIivdoKz1pc8"
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 182
},
"_enabled": true,
"_id": "80PylZIy9EbJR4/AZl0xgK"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "speaker", "_name": "speaker",
...@@ -7816,7 +7891,7 @@ ...@@ -7816,7 +7891,7 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 183 "__id__": 185
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -7872,7 +7947,7 @@ ...@@ -7872,7 +7947,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 182 "__id__": 184
}, },
"_enabled": true, "_enabled": true,
"eff_btn": { "eff_btn": {
...@@ -7976,6 +8051,9 @@ ...@@ -7976,6 +8051,9 @@
"__id__": 81 "__id__": 81
} }
], ],
"mask_node": {
"__id__": 182
},
"_id": "4eioQSfZdPna82l0qiAEEA" "_id": "4eioQSfZdPna82l0qiAEEA"
}, },
{ {
...@@ -7999,7 +8077,7 @@ ...@@ -7999,7 +8077,7 @@
} }
], ],
"canvasView": { "canvasView": {
"__id__": 184 "__id__": 186
}, },
"isCanvas": true, "isCanvas": true,
"_id": "5eOVDDzARGnoMLcNXyk5ml" "_id": "5eOVDDzARGnoMLcNXyk5ml"
......
...@@ -45,6 +45,11 @@ var game = cc.Class({ ...@@ -45,6 +45,11 @@ var game = cc.Class({
type: cc.Button, type: cc.Button,
displayName: "上下页" displayName: "上下页"
}, },
mask_node: {
default: null,
type: cc.Node,
displayName: "遮罩"
}
}, },
ctor: function () { ctor: function () {
...@@ -113,6 +118,12 @@ var game = cc.Class({ ...@@ -113,6 +118,12 @@ var game = cc.Class({
this.btnList[1].node.opacity = 255 / 2; this.btnList[1].node.opacity = 255 / 2;
this.btnList[1].interactable = false; this.btnList[1].interactable = false;
} }
if (g.data_mgr.pageId > 0 && g.data_mgr.pageId < g.data_mgr.data.contentObj.pageArr.length - 1) {
this.btnList[0].node.opacity = 255;
this.btnList[0].interactable = true;
this.btnList[1].node.opacity = 255;
this.btnList[1].interactable = true;
}
} }
}, },
...@@ -174,8 +185,8 @@ var game = cc.Class({ ...@@ -174,8 +185,8 @@ var game = cc.Class({
//初始化界面 //初始化界面
this.UpdataUi(); this.UpdataUi();
//播放游戏开始音效 // //播放游戏开始音效
g.speaker.inst.play_start(); // g.speaker.inst.play_start();
//游戏开始 //游戏开始
g.game.inst.gameStart(); g.game.inst.gameStart();
...@@ -205,11 +216,14 @@ var game = cc.Class({ ...@@ -205,11 +216,14 @@ var game = cc.Class({
}, },
//播放标题音效 //播放标题音效
playAudioTitle: function () { playAudioTitle: function (cb) {
//获得播放路径 //获得播放路径
var path = g.data_mgr.data.contentObj.audio_url; var path = g.data_mgr.data.contentObj.audio_url;
if (path == undefined) {
cb && cb();
}
g.res_mgr.playAudioByUrl(path, (url) => { g.res_mgr.playAudioByUrl(path, (url) => {
g.snd_mgr.playEffect(url); g.snd_mgr.playEffect(url, cb);
}); });
}, },
......
...@@ -2,69 +2,69 @@ ...@@ -2,69 +2,69 @@
* 音效 * 音效
*/ */
var speaker = cc.Class({ var speaker = cc.Class({
extends: cc.Component, extends: cc.Component,
properties: { properties: {
eff_btn: { eff_btn: {
default: null, default: null,
type: cc.AudioClip, type: cc.AudioClip,
displayName: "点击音效" displayName: "点击音效"
}, },
eff_congratulation: { eff_congratulation: {
default: null, default: null,
type: cc.AudioClip, type: cc.AudioClip,
displayName: "撒花音效" displayName: "撒花音效"
}, },
eff_error: { eff_error: {
default: null, default: null,
type: cc.AudioClip, type: cc.AudioClip,
displayName: "点击错误音效" displayName: "点击错误音效"
}, },
eff_good: { eff_good: {
default: null, default: null,
type: cc.AudioClip, type: cc.AudioClip,
displayName: "点击正确音效" displayName: "点击正确音效"
}, },
eff_showPop: { eff_showPop: {
default: null, default: null,
type: cc.AudioClip, type: cc.AudioClip,
displayName: "显示弹窗音效" displayName: "显示弹窗音效"
}, },
eff_start: { eff_start: {
default: null, default: null,
type: cc.AudioClip, type: cc.AudioClip,
displayName: "游戏开始音效" displayName: "游戏开始音效"
}, },
}, },
ctor: function () { ctor: function () {
speaker.inst = this; speaker.inst = this;
g.speaker = speaker; g.speaker = speaker;
}, },
//点击按钮 //点击按钮
play_btn: function () { play_btn: function () {
g.snd_mgr.playEffect(this.eff_btn); g.snd_mgr.playEffect(this.eff_btn);
}, },
//撒花音效 //撒花音效
play_congratulation: function () { play_congratulation: function () {
g.snd_mgr.playEffect(this.eff_congratulation); g.snd_mgr.playEffect(this.eff_congratulation);
}, },
//答错 //答错
play_error: function () { play_error: function () {
g.snd_mgr.playEffect(this.eff_error); g.snd_mgr.playEffect(this.eff_error);
}, },
//答对 //答对
play_good: function () { play_good: function () {
g.snd_mgr.playEffect(this.eff_good); g.snd_mgr.playEffect(this.eff_good);
}, },
//显示弹窗 //显示弹窗
play_showPop: function () { play_showPop: function () {
g.snd_mgr.playEffect(this.eff_showPop); g.snd_mgr.playEffect(this.eff_showPop);
}, },
//游戏开始 //游戏开始
play_start: function () { play_start: function (cb) {
g.snd_mgr.playEffect(this.eff_start); g.snd_mgr.playEffect(this.eff_start, cb);
}, },
}); });
...@@ -116,7 +116,11 @@ g.data_mgr = { ...@@ -116,7 +116,11 @@ g.data_mgr = {
g.game.inst.UpdataUi(); g.game.inst.UpdataUi();
//播放游戏开始音效 //播放游戏开始音效
g.speaker.inst.play_start(); g.speaker.inst.play_start(() => {
g.game.inst.playAudioTitle(() => {
g.game.inst.mask_node.active = false;
});
});
//游戏开始 //游戏开始
g.game.inst.gameStart(); g.game.inst.gameStart();
......
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