Commit 5639f131 authored by Lwd's avatar Lwd

aaaa

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