Commit 95a1c730 authored by 李维's avatar 李维

根据迪格反馈修改

1. 添加完成音频
2. 修改对错号颜色
parent 71e821d8
{
"ver": "2.0.1",
"uuid": "9268b9e5-2c1d-40cd-823c-a946499da62f",
"downloadMode": 0,
"duration": 2.319563,
"subMetas": {}
}
\ No newline at end of file
......@@ -105,19 +105,19 @@
"__id__": 732
},
{
"__id__": 762
"__id__": 764
}
],
"_active": true,
"_components": [
{
"__id__": 765
"__id__": 767
},
{
"__id__": 766
"__id__": 768
},
{
"__id__": 767
"__id__": 769
}
],
"_prefab": null,
......@@ -29173,6 +29173,9 @@
"_children": [
{
"__id__": 760
},
{
"__id__": 762
}
],
"_active": true,
......@@ -29306,6 +29309,87 @@
"preload": false,
"_id": "dey05oKrBIspvsDa6pOIQz"
},
{
"__type__": "cc.Node",
"_name": "finish",
"_objFlags": 0,
"_parent": {
"__id__": 759
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 763
}
],
"_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": "8ebhwyzolLg4uGwPeJaYyS"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 762
},
"_enabled": true,
"_clip": {
"__uuid__": "9268b9e5-2c1d-40cd-823c-a946499da62f"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "e5i4eqxI1NYK3E5PwO9i4/"
},
{
"__type__": "cc.Node",
"_name": "Speaker",
......@@ -29317,10 +29401,10 @@
"_active": false,
"_components": [
{
"__id__": 763
"__id__": 765
},
{
"__id__": 764
"__id__": 766
}
],
"_prefab": null,
......@@ -29376,7 +29460,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 762
"__id__": 764
},
"_enabled": true,
"_defaultClip": {
......@@ -29395,7 +29479,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 762
"__id__": 764
},
"_enabled": true,
"_materials": [
......@@ -29484,7 +29568,7 @@
"__id__": 100
},
"aniSpeaker": {
"__id__": 762
"__id__": 764
},
"_id": "eaTVUpqahPfZeO9+sUI7RP"
}
......
......@@ -4,7 +4,7 @@ import {
loadImageByUrl,
asyncLoadRemote,
getSprNode,
localPosTolocalPos
playLocalAudio
} from "../script/util_DG_FAF";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_DG_FAF";
......@@ -43,13 +43,24 @@ export default class SceneComponent extends MyCocosSceneComponent {
addPreloadImage() {
// TODO 根据自己的配置预加载图片资源
this._imageResList.push({ url: this.data.pic_url });
this._imageResList.push({ url: this.data.pic_url_2 });
if(this.data.bgItem.url) {
this._imageResList.push({ url: this.data.bgItem.url });
}
if(this.data.footer_image_url) {
this._imageResList.push({ url: this.data.footer_image_url });
}
if(this.data.header_image_url) {
this._imageResList.push({ url: this.data.header_image_url });
}
}
addPreloadAudio() {
// TODO 根据自己的配置预加载音频资源
this._audioResList.push({ url: this.data.audio_url });
this.data.hotZoneConfigArr.forEach(config => {
if(config.hotZoneType == AUDIO_PLAY && config.audio_url) {
this._audioResList.push({ url: config.audio_url });
}
});
}
addPreloadAnima() {}
......@@ -342,12 +353,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.scoreShowContainer.opacity = 0;
this.scoreShowContainer.active = true;
cc.tween(this.scoreShowContainer).to(0.1, {
opacity: 255
}).call(()=>{
}).call(async ()=>{
const dragonDisplay = animationNode.getComponent(dragonBones.ArmatureDisplay);
dragonDisplay.playAnimation('newAnimation', 1);
this.showCloseBtn();
playLocalAudio("finish");
}).start()
}
......
......@@ -200,6 +200,17 @@ export function playAudio(audioClip, cb = null) {
}
}
export function playLocalAudio(audioName, callback = null) {
const audio = cc.find(`Canvas/res/audio/${audioName}`).getComponent(cc.AudioSource);
return new Promise((resolve, reject) => {
const id = cc.audioEngine.playEffect(audio.clip, false);
cc.audioEngine.setFinishCallback(id, () => {
resolve(id);
callback && callback();
});
})
}
export async function asyncDelay(time) {
return new Promise((resolve, reject) => {
try {
......
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