SubHallManger.js 2.0 KB

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