Commit effa836a by Jin Liu

-更新combo风格

-增加音阶数
parent 26f0de94
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "4a5942d0-50fd-4ff6-a4c3-00cde9511157", "uuid": "e0ed4b55-caa4-4b58-b479-e6cb210fd4f6",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 288, "width": 323,
"height": 64, "height": 57,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo 10": { "combo10": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "856b347d-e3d1-4c72-a984-79ea47f980ce", "uuid": "f130e570-484d-49ed-97fb-2e1b2a285236",
"rawTextureUuid": "4a5942d0-50fd-4ff6-a4c3-00cde9511157", "rawTextureUuid": "e0ed4b55-caa4-4b58-b479-e6cb210fd4f6",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 288, "width": 323,
"height": 64, "height": 57,
"rawWidth": 288, "rawWidth": 323,
"rawHeight": 64, "rawHeight": 57,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "19c97043-cc04-421e-b90e-8dd0fe1d898c", "uuid": "af4dbe25-18b9-4847-aedc-11eed67cac52",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 259, "width": 293,
"height": 63, "height": 55,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo 3": { "combo2": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "05ef1415-e149-44a9-824e-252442cb112c", "uuid": "a59b557b-0a72-437f-99c4-f3b847a3d895",
"rawTextureUuid": "19c97043-cc04-421e-b90e-8dd0fe1d898c", "rawTextureUuid": "af4dbe25-18b9-4847-aedc-11eed67cac52",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 259, "width": 293,
"height": 63, "height": 55,
"rawWidth": 259, "rawWidth": 293,
"rawHeight": 63, "rawHeight": 55,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "135d85a6-9e33-43c1-8ee4-f821c871e25a", "uuid": "5154db85-d5af-4fe9-be60-70306ab2dce4",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 259, "width": 293,
"height": 63, "height": 55,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo 4": { "combo3": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "f4dd369f-d2f0-4325-836e-d037ccd7c4fe", "uuid": "df1b8305-f48f-4eaa-a1cd-e8aac64ae45f",
"rawTextureUuid": "135d85a6-9e33-43c1-8ee4-f821c871e25a", "rawTextureUuid": "5154db85-d5af-4fe9-be60-70306ab2dce4",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 259, "width": 293,
"height": 63, "height": 55,
"rawWidth": 259, "rawWidth": 293,
"rawHeight": 63, "rawHeight": 55,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "b1fdbd02-318d-4a2b-a869-c64bfa47d121", "uuid": "9f6ef1d7-45de-4f58-ad41-fd75e0a470c0",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 259, "width": 293,
"height": 63, "height": 56,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo 5": { "combo4": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "1187ce07-f52e-46c1-8a68-c3b25c096b5d", "uuid": "a3e6fcb7-06f3-4341-8de8-e0231ce1d8a0",
"rawTextureUuid": "b1fdbd02-318d-4a2b-a869-c64bfa47d121", "rawTextureUuid": "9f6ef1d7-45de-4f58-ad41-fd75e0a470c0",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 259, "width": 293,
"height": 63, "height": 56,
"rawWidth": 259, "rawWidth": 293,
"rawHeight": 63, "rawHeight": 56,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "1bcbe011-3784-4b18-810f-15d516a5447a", "uuid": "f6735407-340d-495b-90b1-a2fb1916d45e",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 260, "width": 293,
"height": 63, "height": 55,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo 6": { "combo5": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "833a3d79-7786-4f74-a319-7e63e5a4e71a", "uuid": "8357f91b-3fd3-47ef-bea2-61cd85cdaafb",
"rawTextureUuid": "1bcbe011-3784-4b18-810f-15d516a5447a", "rawTextureUuid": "f6735407-340d-495b-90b1-a2fb1916d45e",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 260, "width": 293,
"height": 63, "height": 55,
"rawWidth": 260, "rawWidth": 293,
"rawHeight": 63, "rawHeight": 55,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "da473379-a93b-40d3-8d8c-982ab639ef85", "uuid": "34b40248-912b-42c8-83d4-8b186a1bbcbf",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 262, "width": 293,
"height": 63, "height": 55,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo 7": { "combo6": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "e319449d-8c19-491c-8423-e29213425a67", "uuid": "83bb6eae-b081-43f1-8ec0-109750c6bf3f",
"rawTextureUuid": "da473379-a93b-40d3-8d8c-982ab639ef85", "rawTextureUuid": "34b40248-912b-42c8-83d4-8b186a1bbcbf",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 262, "width": 293,
"height": 63, "height": 55,
"rawWidth": 262, "rawWidth": 293,
"rawHeight": 63, "rawHeight": 55,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "08f45706-5570-4561-ac8c-491cd8c209a6", "uuid": "f45fb645-1e5a-4ecc-9c29-ba4653d4f132",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 259, "width": 296,
"height": 65, "height": 55,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo 8": { "combo7": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "7a045b38-b63c-44b4-af85-89d0b2e4c109", "uuid": "8452dc4b-8ef9-437b-9630-ff23137636c1",
"rawTextureUuid": "08f45706-5570-4561-ac8c-491cd8c209a6", "rawTextureUuid": "f45fb645-1e5a-4ecc-9c29-ba4653d4f132",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 259, "width": 296,
"height": 65, "height": 55,
"rawWidth": 259, "rawWidth": 296,
"rawHeight": 65, "rawHeight": 55,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "95c878b1-1cfd-4205-8062-fc6feb37590b", "uuid": "4f54b81b-c215-4ba8-8459-37ebab9a6b4f",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 261, "width": 293,
"height": 64, "height": 56,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo 9": { "combo8": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "bd626235-b4df-44cf-8e6e-0922e1e92f44", "uuid": "0b64f798-41ec-4259-b454-d79436316eee",
"rawTextureUuid": "95c878b1-1cfd-4205-8062-fc6feb37590b", "rawTextureUuid": "4f54b81b-c215-4ba8-8459-37ebab9a6b4f",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 261, "width": 293,
"height": 64, "height": 56,
"rawWidth": 261, "rawWidth": 293,
"rawHeight": 64, "rawHeight": 56,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
{
{ {
"ver": "2.3.4", "ver": "2.3.4",
"uuid": "afd1a7d2-1cfe-49bb-a96a-18c9d4b3819f", "uuid": "dbfed407-6a97-412c-b16d-6cc97229eecd",
"type": "sprite", "type": "sprite",
"wrapMode": "clamp", "wrapMode": "clamp",
"filterMode": "bilinear", "filterMode": "bilinear",
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 247, "width": 294,
"height": 68, "height": 55,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"combo": { "combo9": {
"ver": "1.0.4", "ver": "1.0.4",
"uuid": "dda2af79-7c2c-49fa-9b2c-1043da923188", "uuid": "bf4cc769-e1ca-425a-b483-3fbc65592ef0",
"rawTextureUuid": "afd1a7d2-1cfe-49bb-a96a-18c9d4b3819f", "rawTextureUuid": "dbfed407-6a97-412c-b16d-6cc97229eecd",
"trimType": "auto", "trimType": "auto",
"trimThreshold": 1, "trimThreshold": 1,
"rotated": false, "rotated": false,
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
"offsetY": 0, "offsetY": 0,
"trimX": 0, "trimX": 0,
"trimY": 0, "trimY": 0,
"width": 247, "width": 294,
"height": 68, "height": 55,
"rawWidth": 247, "rawWidth": 294,
"rawHeight": 68, "rawHeight": 55,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 0,
......
...@@ -92,34 +92,35 @@ ...@@ -92,34 +92,35 @@
}, },
"spriteList": [ "spriteList": [
{ {
"__uuid__": "dda2af79-7c2c-49fa-9b2c-1043da923188" "__uuid__": "a59b557b-0a72-437f-99c4-f3b847a3d895"
}, },
{ {
"__uuid__": "05ef1415-e149-44a9-824e-252442cb112c" "__uuid__": "df1b8305-f48f-4eaa-a1cd-e8aac64ae45f"
}, },
{ {
"__uuid__": "f4dd369f-d2f0-4325-836e-d037ccd7c4fe" "__uuid__": "a3e6fcb7-06f3-4341-8de8-e0231ce1d8a0"
}, },
{ {
"__uuid__": "1187ce07-f52e-46c1-8a68-c3b25c096b5d" "__uuid__": "8357f91b-3fd3-47ef-bea2-61cd85cdaafb"
}, },
{ {
"__uuid__": "833a3d79-7786-4f74-a319-7e63e5a4e71a" "__uuid__": "83bb6eae-b081-43f1-8ec0-109750c6bf3f"
}, },
{ {
"__uuid__": "e319449d-8c19-491c-8423-e29213425a67" "__uuid__": "8452dc4b-8ef9-437b-9630-ff23137636c1"
}, },
{ {
"__uuid__": "7a045b38-b63c-44b4-af85-89d0b2e4c109" "__uuid__": "0b64f798-41ec-4259-b454-d79436316eee"
}, },
{ {
"__uuid__": "bd626235-b4df-44cf-8e6e-0922e1e92f44" "__uuid__": "bf4cc769-e1ca-425a-b483-3fbc65592ef0"
}, },
{ {
"__uuid__": "856b347d-e3d1-4c72-a984-79ea47f980ce" "__uuid__": "f130e570-484d-49ed-97fb-2e1b2a285236"
} }
], ],
"tween": null, "tween": null,
"fxManager": null,
"_id": "" "_id": ""
}, },
{ {
...@@ -137,9 +138,7 @@ ...@@ -137,9 +138,7 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_spriteFrame": { "_spriteFrame": null,
"__uuid__": "dda2af79-7c2c-49fa-9b2c-1043da923188"
},
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 1,
"_fillType": 0, "_fillType": 0,
......
...@@ -105,13 +105,22 @@ ...@@ -105,13 +105,22 @@
}, },
"comboSoundFx": [ "comboSoundFx": [
{ {
"__uuid__": "8d0e650a-1ffb-4714-b478-59ac89b64590" "__uuid__": "1667bc6a-dff0-4246-a012-667c2025a932"
}, },
{ {
"__uuid__": "14b6ce19-48f4-424f-b3f9-d32990910e51" "__uuid__": "064b266f-1147-43ae-b862-b6005bf7892c"
}, },
{ {
"__uuid__": "00fc4eac-2539-41a2-81bb-2489bb229510" "__uuid__": "fb08e4b3-ce63-4ab9-9f16-eb961d63d949"
},
{
"__uuid__": "c1088c25-5c85-47e2-af0c-518be044bb6e"
},
{
"__uuid__": "0c60791c-371a-4857-9463-0d08e81d8c8d"
},
{
"__uuid__": "ad8afd24-d95a-4de8-91d1-0b16e7d2935d"
} }
], ],
"awardSoundFx": [ "awardSoundFx": [
......
let { AwardManager, ComboManager } = require('FreeCollection') let { AwardManager, ComboManager, FxManager } = require('FreeCollection')
cc.Class({ cc.Class({
extends: cc.Component, extends: cc.Component,
...@@ -20,15 +20,27 @@ cc.Class({ ...@@ -20,15 +20,27 @@ cc.Class({
}, },
init() { init() {
//初始化音频管理类
let fxGroup = [];
for(let i = 0; i < 3; i++){
let fx = cc.instantiate(this.soundFxPre);
this.node.addChild(fx);
fxGroup.push(fx.getComponent("FreeSoundFx"));
}
this.fxManager = new FxManager(fxGroup);
//初始化奖励管理类
let award = cc.instantiate(this.awardEffectPre); let award = cc.instantiate(this.awardEffectPre);
this.node.addChild(award); this.node.addChild(award);
let awardControl = award.getComponent("FreeAwardEffect"); let awardControl = award.getComponent("FreeAwardEffect");
awardControl.fxManager = this.fxManager;
this.awardManager = new AwardManager(awardControl); this.awardManager = new AwardManager(awardControl);
//初始化combo管理类
let combo = cc.instantiate(this.comboEffectPre); let combo = cc.instantiate(this.comboEffectPre);
this.node.addChild(combo); this.node.addChild(combo);
let comboControl = combo.getComponent("FreeComboEffect"); let comboControl = combo.getComponent("FreeComboEffect");
comboControl.fxManager = this.fxManager;
this.comboManager = new ComboManager(comboControl); this.comboManager = new ComboManager(comboControl);
}, },
//设置奖励文字与Combo计数的关系,args为多个参数 //设置奖励文字与Combo计数的关系,args为多个参数
setAward(data) { setAward(data) {
......
...@@ -15,7 +15,8 @@ cc.Class({ ...@@ -15,7 +15,8 @@ cc.Class({
spriteList: [cc.SpriteFrame], spriteList: [cc.SpriteFrame],
mySprite:cc.Sprite, mySprite:cc.Sprite,
playFxPrefab: cc.Prefab, playFxPrefab: cc.Prefab,
tween:null tween:null,
fxManager:null
}, },
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
...@@ -58,9 +59,7 @@ cc.Class({ ...@@ -58,9 +59,7 @@ cc.Class({
.start(); .start();
}, },
playFx(num) { playFx(num) {
let playFxPrefab = cc.instantiate(this.playFxPrefab); this.fxManager.playAwardFx(num);
this.node.addChild(playFxPrefab);
playFxPrefab.getComponent('FreeSoundFx').playAwardFx(num);
}, },
// update (dt) {}, // update (dt) {},
}); });
...@@ -6,8 +6,8 @@ class AwardManager { ...@@ -6,8 +6,8 @@ class AwardManager {
addAward(data) { addAward(data) {
if (data.length > this.award.spriteList.length) { if (data.length > this.award.spriteList.length) {
console.warn("当前只设置了"+this.award.spriteList.length+"张奖励图片,但提供了"+data.length+"个奖励位置,多出的奖励将不会显示"); console.warn("当前只设置了" + this.award.spriteList.length + "张奖励图片,但提供了" + data.length + "个奖励位置,多出的奖励将不会显示");
data = data.slice(0,this.award.spriteList.length); data = data.slice(0, this.award.spriteList.length);
} }
this.awardList = data; this.awardList = data;
} }
...@@ -43,10 +43,8 @@ class ComboManager { ...@@ -43,10 +43,8 @@ class ComboManager {
} }
comboAdd() { comboAdd() {
this.comboCacul++; this.comboCacul++;
if (this.awardManager) { if (this.comboCacul > 1 && this.awardManager) this.awardManager.checkAward(this.comboCacul - 1);
this.awardManager.checkAward(this.comboCacul); if (this.comboCacul > 1) this.combo.showCombo(this.comboCacul - 1);
}
this.combo.showCombo(this.comboCacul);
/// ///
//console.log("----" + "combo*" + this.comboCacul + "出现了----") //console.log("----" + "combo*" + this.comboCacul + "出现了----")
} }
...@@ -64,4 +62,28 @@ class ComboManager { ...@@ -64,4 +62,28 @@ class ComboManager {
console.log("combo", this.combo); console.log("combo", this.combo);
} }
} }
export default{AwardManager,ComboManager} class FxManager {
\ No newline at end of file constructor(group) {
this.fxGroup = group;
try {
this.preReadyFx = this.fxGroup[0];
} catch (e) {
console.log("FxManager构造函数报错");
console.error(e);
}
}
playAwardFx(num) {
let fx = this.getOneFx();
fx.playAwardFx(num);
}
playComboFx(num) {
let fx = this.getOneFx();
fx.playComboFx(num);
}
getOneFx() {
let readyFx = this.fxGroup.shift();
this.fxGroup.push(readyFx);
return readyFx;
}
}
export default { AwardManager, ComboManager, FxManager }
\ No newline at end of file
...@@ -16,7 +16,7 @@ cc.Class({ ...@@ -16,7 +16,7 @@ cc.Class({
playFxPrefab: cc.Prefab, playFxPrefab: cc.Prefab,
spriteList: [cc.SpriteFrame], spriteList: [cc.SpriteFrame],
tween: null, tween: null,
fxManager:null
}, },
// LIFE-CYCLE CALLBACKS: // LIFE-CYCLE CALLBACKS:
...@@ -51,7 +51,7 @@ cc.Class({ ...@@ -51,7 +51,7 @@ cc.Class({
this.tween = cc.tween(this.node) this.tween = cc.tween(this.node)
.by(0.4, { scale: 1.2, position: cc.v2(0, 150) }, { easing: 'backOut' }) .by(0.4, { scale: 1.2, position: cc.v2(0, 150) }, { easing: 'backOut' })
.by(0.8, { scale: 0, position: cc.v2(0, 0) }) .by(0.8, { scale: 0, position: cc.v2(0, 0) })
.to(0.4, { scale: 0, position: cc.v2(0, 300) }, { easing: 'backIn' }) .to(0.4, { scale: 0, position: cc.v2(0, 150) }, { easing: 'backIn' })
.call(() => { .call(() => {
//console.log('combo动画效果'); //console.log('combo动画效果');
this.doClose(); this.doClose();
...@@ -61,9 +61,7 @@ cc.Class({ ...@@ -61,9 +61,7 @@ cc.Class({
}, },
playFx(num) { playFx(num) {
let playFxPrefab = cc.instantiate(this.playFxPrefab); this.fxManager.playComboFx(num);
this.node.addChild(playFxPrefab);
playFxPrefab.getComponent('FreeSoundFx').playComboFx(num);
}, },
// update (dt) {}, // update (dt) {},
}); });
...@@ -12,9 +12,6 @@ cc.Class({ ...@@ -12,9 +12,6 @@ cc.Class({
// onLoad () {}, // onLoad () {},
start() {
},
playComboFx(num) { playComboFx(num) {
this.playFx(0, num); this.playFx(0, num);
...@@ -29,17 +26,7 @@ cc.Class({ ...@@ -29,17 +26,7 @@ cc.Class({
} else { } else {
clip = this.awardSoundFx[(num - 1)%this.awardSoundFx.length]; clip = this.awardSoundFx[(num - 1)%this.awardSoundFx.length];
} }
this.audioSource.clip = clip; this.audioSource.clip = clip;
this.isPlay = true;
this.audioSource.play(); this.audioSource.play();
}, },
update(dt) {
if (this.isPlay == false) return;
if (!this.audioSource.isPlaying) {
this.node.destroy();
// console.log('PhreeSoundFx已销毁');
}
},
}); });
{ {
"ver": "2.0.0", "ver": "2.0.0",
"uuid": "8d0e650a-1ffb-4714-b478-59ac89b64590", "uuid": "1667bc6a-dff0-4246-a012-667c2025a932",
"downloadMode": 0, "downloadMode": 0,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "2.0.0", "ver": "2.0.0",
"uuid": "14b6ce19-48f4-424f-b3f9-d32990910e51", "uuid": "064b266f-1147-43ae-b862-b6005bf7892c",
"downloadMode": 0, "downloadMode": 0,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{ {
"ver": "2.0.0", "ver": "2.0.0",
"uuid": "00fc4eac-2539-41a2-81bb-2489bb229510", "uuid": "fb08e4b3-ce63-4ab9-9f16-eb961d63d949",
"downloadMode": 0, "downloadMode": 0,
"subMetas": {} "subMetas": {}
} }
\ No newline at end of file
{
"ver": "2.0.0",
"uuid": "c1088c25-5c85-47e2-af0c-518be044bb6e",
"downloadMode": 0,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.0",
"uuid": "0c60791c-371a-4857-9463-0d08e81d8c8d",
"downloadMode": 0,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.0.0",
"uuid": "ad8afd24-d95a-4de8-91d1-0b16e7d2935d",
"downloadMode": 0,
"subMetas": {}
}
\ No newline at end of file
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