SubHallManger.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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(gameid)
  16. {
  17. this.gameid = gameid
  18. this.SceneLevel = 1
  19. if (this.getPageData) {
  20. this.getPageData()
  21. }
  22. },
  23. playShow()
  24. {
  25. this.node.active = true
  26. var actionTo = cc.moveBy(0.3, cc.v2(-this.node.parent.width, 0));
  27. this.node.width = this.node.parent.width
  28. this.node.runAction(actionTo)
  29. // this.setShowingHall(this)
  30. if (this.parentScene.setShowingHall) {
  31. this.parentScene.setShowingHall(this)
  32. }
  33. },
  34. playEnd(nextScense)
  35. {
  36. var finished = cc.callFunc(function() {
  37. this.node.active = false;
  38. if (this.parentScene) {
  39. if(nextScense && nextScense.playShow)
  40. {
  41. nextScense.playShow()
  42. if (this.parentScene.setShowingHall) {
  43. this.parentScene.setShowingHall(nextScense)
  44. }
  45. }else if (this.parentScene && this.parentScene.playShow) {
  46. this.parentScene.playShow()
  47. if (this.parentScene.setShowingHall) {
  48. this.parentScene.setShowingHall(this.parentScene)
  49. }
  50. // if (this.parentScene.parentScene && this.parentScene.parentScene.setHalllistDisplay) {
  51. // this.parentScene.parentScene.setHalllistDisplay(true)
  52. // }
  53. }
  54. }
  55. if (this.extraPlay) {
  56. this.extraPlay()
  57. }
  58. }, this, null);
  59. var actionTo = cc.sequence(cc.moveBy(0.3, cc.v2(this.node.parent.width, 0)),finished);
  60. this.node.runAction(actionTo)
  61. },
  62. setShowingHall(hall){
  63. if (this.parentScene && this.parentScene.setShowingHall) {
  64. this.parentScene.setShowingHall(hall)
  65. }
  66. },
  67. });