This commit is contained in:
tothvillar
2026-07-09 15:04:14 +08:00
commit e896e2ead4
1180 changed files with 115132 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
cc.Class({
extends: cc.Component,
properties: {
needMergeEventNodes: {
default: [],
type: cc.Node,
displayName: "需要合并的事件节点"
},
startDelayTime: {
default: 0,
displayName: "起始延迟的时间"
},
isAutomatic: {
default: false,
displayName: "是否自动触发"
},
yinyue: {
default: "",
displayName: "播放的声音名"
},
soundTime: {
default: 0,
displayName: "声音起始延迟的时间"
}
},
onLoad: function () {
this.node.switchEvent = this.switchEvent.bind(this);
},
start: function () {
1 == this.isAutomatic && this.switchEvent();
},
switchEvent: function () {
var e = this;
setTimeout(function () {
if (e.yinyue) {
cc.global.Source.onStopBjM();
cc.global.Source.onPlayBtnEffect(e.yinyue);
}
}, this.soundTime);
this.node.stopAllActions();
cc.tween(this.node).delay(this.startDelayTime).call(function () {
for (var o = 0; o < e.needMergeEventNodes.length; o++) {
e.needMergeEventNodes[o] && e.needMergeEventNodes[o].switchEvent();
}
}).start();
}
});