|
|
@@ -109,22 +109,30 @@ export default class Guide extends cc.Component {
|
|
|
x = pos.x;
|
|
|
y = pos.y;
|
|
|
|
|
|
- //lastStruggle
|
|
|
- if (this.crtGuide && this.crtGuide.id == 2 && this.crtStep == 1) {
|
|
|
- w = this.targetNode.parent.width;
|
|
|
- h = this.targetNode.parent.height;
|
|
|
- let pos1 = mk.game.getWorldPos(this.targetNode.parent);
|
|
|
- x = pos1.x;
|
|
|
- y = pos1.y - h / 2;
|
|
|
- }
|
|
|
+ // //lastStruggle
|
|
|
+ // if (this.crtGuide && this.crtGuide.id == 2 && this.crtStep == 1) {
|
|
|
+ // w = this.targetNode.parent.width;
|
|
|
+ // h = this.targetNode.parent.height;
|
|
|
+ // let pos1 = mk.game.getWorldPos(this.targetNode.parent);
|
|
|
+ // x = pos1.x;
|
|
|
+ // y = pos1.y - h / 2;
|
|
|
+ // }
|
|
|
|
|
|
- //穿透点击目标节点时增加一个事件触发下一步,触发后移除
|
|
|
- this.node_click.width = this.node_click.height = 0;
|
|
|
- let eventHandler = new cc.Component.EventHandler();
|
|
|
- eventHandler.target = this.node;
|
|
|
- eventHandler.component = "Guide";
|
|
|
- eventHandler.handler = "clickNodeClick";
|
|
|
- this.targetNode.getComponent(cc.Button).clickEvents.push(eventHandler);
|
|
|
+ if (this.crtGuide.btnEnable == '1') {
|
|
|
+ //穿透点击目标节点时增加一个事件触发下一步,触发后移除
|
|
|
+ this.node_click.width = this.node_click.height = 0;
|
|
|
+ let eventHandler = new cc.Component.EventHandler();
|
|
|
+ eventHandler.target = this.node;
|
|
|
+ eventHandler.component = "Guide";
|
|
|
+ eventHandler.handler = "clickNodeClick";
|
|
|
+ this.targetNode.getComponent(cc.Button).clickEvents.push(eventHandler);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.node_click.x = 0;
|
|
|
+ this.node_click.y = 0;
|
|
|
+ this.node_click.width = this.node.width;
|
|
|
+ this.node_click.height = this.node.height;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//显示区域由大到小动画
|
|
|
@@ -254,9 +262,12 @@ export default class Guide extends cc.Component {
|
|
|
mk.audio.playEffect("button");
|
|
|
cc.Tween.stopAllByTarget(this.node_display);
|
|
|
console.log("clickNodeClick");
|
|
|
- if (this.targetNode) {
|
|
|
- this.targetNode.getComponent(cc.Button).clickEvents.pop();
|
|
|
+ if (this.crtGuide.btnEnable == '1') {
|
|
|
+ if (this.targetNode) {
|
|
|
+ this.targetNode.getComponent(cc.Button).clickEvents.pop();
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
if (this.event_data) {
|
|
|
//event_guide data:1_2 (1_2为新手引导的id)
|
|
|
mk.event.emit("event_guide", this.event_data);
|