import GamesHallController from "../view/GamesHallController" cc.Class({ extends: cc.Component, properties: { }, ctor: function () { }, onLoad () { }, start () { }, onDestroy() { }, playShow(parentHall) { if (parentHall) { this.parentHall = parentHall } this.node.active = true console.log("this.node.width is ====",this.node.width) console.log("this.MoveNum is ====",this.MoveNum) var actionTo = cc.moveBy(0.3, cc.v2(-this.node.parent.width, 0)); var actionTo1 = cc.moveBy(0.3, cc.v2(100, 0)); this.node.width = this.node.parent.width this.node.runAction(actionTo) // if (this.plane) { // this.plane.runAction(actionTo1) // } this.setShowingHall(this) }, playEnd(direction,nextScense) { var finished = cc.callFunc(function() { this.node.active = false; if (this.parentHall && this.parentHall.playShow && direction == "up") { this.parentHall.playShow() if (this.parentHall.parentHall && this.parentHall.parentHall.setHalllistDisplay) { this.parentHall.parentHall.setHalllistDisplay(true) } this.showingHall = this.parentHall }else if (direction == "down") { if (this.parentHall && this.parentHall.setHalllistDisplay) { this.parentHall.setHalllistDisplay(false) } this.showingHall.playShow(this) }else if(this.parentHall && nextScense && direction == 'horizontal') { nextScense.playShow(this.parentHall) this.showingHall = nextScense } this.setShowingHall(this.showingHall) }, this, null); var actionTo = cc.sequence(cc.moveBy(0.3, cc.v2(this.node.parent.width, 0)),finished); var actionTo1 = cc.moveBy(0.3, cc.v2(-103, 0)); this.node.runAction(actionTo) // if (this.plane) { // this.plane.runAction(actionTo1) // } }, setShowingHall(Hall) { if (this.parentHall && this.parentHall.setShowingHall && this.parentHall != this) { this.showingHall = Hall this.parentHall.setShowingHall(this.showingHall) } } });