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
+36
View File
@@ -0,0 +1,36 @@
cc.Class({
extends: cc.Component,
properties: {
img: {
default: null,
type: cc.SpriteFrame,
displayName: "更换的图片"
},
startTime: {
default: 0,
displayName: "起始延迟时间"
},
returnDelayTime: {
default: -1,
displayName: "返回延迟的时间,负数为不返回"
},
eventNode_over: {
default: null,
type: cc.Node,
displayName: "结束事件节点"
}
},
start: function () {
this.node.switchEvent = this.switchEvent.bind(this);
},
switchEvent: function () {
var e = this;
var o = this.node.getComponent(cc.Sprite);
cc.tween(o).delay(this.startTime).call(function () {
o.spriteFrame = e.img;
e.eventNode_over && e.eventNode_over.switchEvent();
}).start();
},
returnStartPos: function () {},
restoreEvent: function () {}
});