Commit e6a89b70 authored by Tt's avatar Tt

基础音效增加完成

parent 7558dbf9
......@@ -123,13 +123,13 @@
"_active": true,
"_components": [
{
"__id__": 130
"__id__": 138
},
{
"__id__": 131
"__id__": 139
},
{
"__id__": 132
"__id__": 140
}
],
"_prefab": null,
......@@ -1970,7 +1970,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "48Z3jduBRMPrHot7j2IxyG"
"_id": "73ZnEP4FJMVaWcshSwMy35"
},
{
"__type__": "cc.Label",
......@@ -2003,7 +2003,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "43xv8n2I5G1pceqlszKD7G"
"_id": "d7AW/cSWdIUbNnujzQlKg8"
},
{
"__type__": "cc.PrivateNode",
......@@ -2066,7 +2066,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "74bHO2GiNKlYkDLUQLYP09"
"_id": "6163ZJ0VlFd4SKIJuAWVxd"
},
{
"__type__": "cc.Label",
......@@ -2099,7 +2099,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "190bhBKaBDJ7taNTyH19Jf"
"_id": "4b6Q98uaVArYmslDmxFtPS"
},
{
"__type__": "cc.RichText",
......@@ -2670,7 +2670,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "0dfRVSC/NDEpxsyoessiR5"
"_id": "6b25fshBdAcZ925W8rw5+Z"
},
{
"__type__": "cc.Label",
......@@ -2703,7 +2703,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "e39Y+1VxpPjq0JRkM/z6hY"
"_id": "b2xnNVtpdKW5sVkcuuhn6A"
},
{
"__type__": "cc.PrivateNode",
......@@ -2766,7 +2766,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "0cc1So86JPdLJ8m6PalWuX"
"_id": "19Ll3MbxJEIJFugc7C1KiZ"
},
{
"__type__": "cc.Label",
......@@ -2799,7 +2799,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "0bURBOb5RHzoG+jXD08Tb/"
"_id": "70Hy0l+HlLL6jv4Oa/VGnQ"
},
{
"__type__": "cc.PrivateNode",
......@@ -2862,7 +2862,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "adr0fgVT5F2YSP9mwHNTFi"
"_id": "e1fr/H00RM7KVEqIH3G4d/"
},
{
"__type__": "cc.Label",
......@@ -2895,7 +2895,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "0bm+4cQ05AurubQ6lzAZaC"
"_id": "f3up8mDHBEZp5ywvqP5dsa"
},
{
"__type__": "cc.PrivateNode",
......@@ -2958,7 +2958,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "2b4Zmt95JLKYcPQAgEYZIO"
"_id": "04FBRKuCdLG4OU4HCnIcWA"
},
{
"__type__": "cc.Label",
......@@ -2991,7 +2991,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "a1ZiXeOxxFJoJJLVy70apC"
"_id": "f2dotnXQhL77vqB93/LjKd"
},
{
"__type__": "cc.RichText",
......@@ -3994,7 +3994,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "d3LH3k1CFP+KTFc0g6PICc"
"_id": "80WAH5fCtIQIq7PXEAb4Vc"
},
{
"__type__": "cc.Label",
......@@ -4027,7 +4027,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "02z6rUjlBGzbVgYSgwGuUx"
"_id": "4916d62wtIsKHym/+iAjTM"
},
{
"__type__": "cc.PrivateNode",
......@@ -4090,7 +4090,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "723f/1u9ZNmq9e9ZmdLnLj"
"_id": "099oYJ7a5MUI1RQSuTTjCD"
},
{
"__type__": "cc.Label",
......@@ -4123,7 +4123,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "308scEbkBHkZ9zZPpIzVXG"
"_id": "21THjUVipHqaR5HNe3rqdJ"
},
{
"__type__": "cc.PrivateNode",
......@@ -4186,7 +4186,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "80fbF0yYNLMYqPzDvTaN0I"
"_id": "23ACx9nSBITrg7kKxwaHNt"
},
{
"__type__": "cc.Label",
......@@ -4219,7 +4219,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "28LLZxvNxIfLjFl7ElakpP"
"_id": "4bVeqIdTtN/5vQHNX2Vegq"
},
{
"__type__": "cc.PrivateNode",
......@@ -4282,7 +4282,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "6buqDgyr5N7KrEroEg8Cui"
"_id": "7eW3Nsl1RC/6emGLmGgWUu"
},
{
"__type__": "cc.Label",
......@@ -4315,7 +4315,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "afBH4AcuhCJIesyoHNh9PY"
"_id": "8atYUeTilNj7v4MuBkGe1B"
},
{
"__type__": "cc.PrivateNode",
......@@ -4378,7 +4378,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "e3t3E1CPVE/L4rHYv05ikh"
"_id": "eeXSTCroZKzYT7CcIMR6G2"
},
{
"__type__": "cc.Label",
......@@ -4411,7 +4411,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "5cLcvMPt5BA6FA6K12izRP"
"_id": "a3CN09Tb1JAqYB3+qLH32v"
},
{
"__type__": "cc.RichText",
......@@ -6337,6 +6337,18 @@
"_children": [
{
"__id__": 128
},
{
"__id__": 130
},
{
"__id__": 132
},
{
"__id__": 134
},
{
"__id__": 136
}
],
"_active": true,
......@@ -6470,6 +6482,330 @@
"preload": false,
"_id": "dey05oKrBIspvsDa6pOIQz"
},
{
"__type__": "cc.Node",
"_name": "dragdown",
"_objFlags": 0,
"_parent": {
"__id__": 127
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 131
}
],
"_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.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": "aaSrAEh8dNIaDu0wikJCMm"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 130
},
"_enabled": true,
"_clip": {
"__uuid__": "1e99096f-d208-43ba-9027-3ffb4c70de4e"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "b0JfX7EsRLt4HEO2KUSlBN"
},
{
"__type__": "cc.Node",
"_name": "nextgame",
"_objFlags": 0,
"_parent": {
"__id__": 127
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 133
}
],
"_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.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": "68Q4sfDYJNtog4jHK/Jj79"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 132
},
"_enabled": true,
"_clip": {
"__uuid__": "5043d28c-815e-4ffd-b063-ded3b031b04b"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "55mCkrNNdDKLZhQPjTWvk5"
},
{
"__type__": "cc.Node",
"_name": "boom",
"_objFlags": 0,
"_parent": {
"__id__": 127
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 135
}
],
"_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.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": "59KURkYYNGa7XRwYEk4WO8"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 134
},
"_enabled": true,
"_clip": {
"__uuid__": "af867b09-1fd5-48ea-8de5-f8e2278cc61f"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "f1NLOZpHdA1YKZANPrh7Cr"
},
{
"__type__": "cc.Node",
"_name": "pie_drop",
"_objFlags": 0,
"_parent": {
"__id__": 127
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 137
}
],
"_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.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": "14A8mKEgxJ8q/rhrJan2Uk"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 136
},
"_enabled": true,
"_clip": {
"__uuid__": "e4f331a2-36ce-4fc1-9673-f3135deddb86"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "95X9g64cVO5JB131ZnufbM"
},
{
"__type__": "cc.Canvas",
"_name": "",
......
......@@ -181,6 +181,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
meetCurrentTouchNode: cc.Node;
onTouchMeetStart(event) {
this.playLocalAudio('dragdown')
this.waitTime = 8;
if (this.guide == 1) return;
let node = event.target;
......@@ -318,6 +319,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
vegetableCurrentTouchNode: cc.Node;
onTouchVegetableStart(event) {
this.playLocalAudio('dragdown')
this.waitTime = 8;
if (this.guide == 0) return;
let node = event.target;
......@@ -400,15 +402,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
node.x = SceneComponent.pieStartPos.x;
node.y = SceneComponent.pieStartPos.y;
this.updateItemPie(node, this.currentQuestion);
this.playLocalAudio('pie_drop')
cc.tween(node)
.to(0.5, { x: SceneComponent.pieDefaultPos.x, y: SceneComponent.pieDefaultPos.y - 50 })
.to(0.06, { x: SceneComponent.pieDefaultPos.x, y: SceneComponent.pieDefaultPos.y })
.call(() => {
this.playLocalAudio('boom')
let ani = pg.view.find(node, 'ani')
ani.active = true;
pg.view.playDBAnimation(ani, 'normal', 1)
node.parent = this.currentMain
}).delay(0.5).call(() => {
}).delay(0.9).call(() => {
this.nextStage();
})
.start();
......@@ -525,6 +529,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.discardCurrent();
// 中间移出
cc.tween(this.currentMain).by(1, { y: -1800 }).start();
this.playLocalAudio('nextgame')
// 中间移入
let node = this.nextLayoutMain(this.nextQuestion);
// 切换题目主体
......@@ -545,6 +550,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.createCurrent();
// 中间移出
cc.tween(this.currentMain).by(1, { y: -1800 }).start();
this.playLocalAudio('nextgame')
// 中间移入
let node = this.nextLayoutMain(this.preQuestion);
// 切换题目主体
......
......@@ -570,7 +570,10 @@ let pg = {
audio: {
playAudioByUrl(audio_url, cb = null, loadCb = null) {
return new Promise((resolve, reject) => {
if (!audio_url) return resolve(null);
if (!audio_url) {
cb && cb();
return resolve(null);
}
cc.assetManager.loadRemote(audio_url, (err, audioClip: any) => {
cc.audioEngine.stopAllEffects();
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
......
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