SubHallManger.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import GamesHallController from "../view/GamesHallController"
  2. cc.Class({
  3. extends: cc.Component,
  4. properties: {
  5. },
  6. ctor: function () {
  7. },
  8. onLoad () {
  9. },
  10. start () {
  11. },
  12. onDestroy()
  13. {
  14. },
  15. initScene()
  16. {
  17. this.SceneLevel = 1
  18. },
  19. playShow()
  20. {
  21. this.node.active = true
  22. var actionTo = cc.moveBy(0.3, cc.v2(-this.node.parent.width, 0));
  23. this.node.width = this.node.parent.width
  24. this.node.runAction(actionTo)
  25. // this.setShowingHall(this)
  26. if (this.parentScene.setShowingHall) {
  27. this.parentScene.setShowingHall(this)
  28. }
  29. },
  30. playEnd(nextScense)
  31. {
  32. var finished = cc.callFunc(function() {
  33. this.node.active = false;
  34. if (this.parentScene) {
  35. if(nextScense && nextScense.playShow)
  36. {
  37. nextScense.playShow()
  38. if (this.parentScene.setShowingHall) {
  39. this.parentScene.setShowingHall(nextScense)
  40. }
  41. }else if (this.parentScene && this.parentScene.playShow) {
  42. this.parentScene.playShow()
  43. if (this.parentScene.setShowingHall) {
  44. this.parentScene.setShowingHall(this.parentScene)
  45. }
  46. // if (this.parentScene.parentScene && this.parentScene.parentScene.setHalllistDisplay) {
  47. // this.parentScene.parentScene.setHalllistDisplay(true)
  48. // }
  49. }
  50. }
  51. if (this.extraPlay) {
  52. this.extraPlay()
  53. }
  54. }, this, null);
  55. var actionTo = cc.sequence(cc.moveBy(0.3, cc.v2(this.node.parent.width, 0)),finished);
  56. this.node.runAction(actionTo)
  57. },
  58. setShowingHall(hall){
  59. if (this.parentScene && this.parentScene.setShowingHall) {
  60. this.parentScene.setShowingHall(hall)
  61. }
  62. },
  63. });