GameSideBar.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. GameCourse: {
  5. default: null,
  6. type: cc.Node,
  7. serializable: true,
  8. },
  9. GameEvent: {
  10. default: null,
  11. type: cc.Node,
  12. serializable: true,
  13. },
  14. GameShop: {
  15. default: null,
  16. type: cc.Node,
  17. serializable: true,
  18. },
  19. GameRanking: {
  20. default: null,
  21. type: cc.Node,
  22. serializable: true,
  23. },
  24. },
  25. OnCourseOpen(event, customEventData)
  26. {
  27. this.GameCourse.active = true;
  28. this.GameCourse.getComponent('GameCourse').OnActive();
  29. },
  30. OnCourseClose(event, customEventData)
  31. {
  32. this.GameCourse.active = false;
  33. },
  34. OnEventOpen(event, customEventData)
  35. {
  36. this.GameEvent.active = true;
  37. this.GameEvent.getComponent('GameEvent').OnActive();
  38. },
  39. OnEventClose(event, customEventData)
  40. {
  41. this.GameEvent.active = false;
  42. },
  43. OnShopOpen(event, customEventData)
  44. {
  45. this.GameShop.active = true;
  46. this.GameShop.getComponent('GameShop').OnActive();
  47. },
  48. OnShopClose(event, customEventData)
  49. {
  50. this.GameShop.active = false;
  51. },
  52. OnRankingOpen(event, customEventData)
  53. {
  54. this.GameRanking.active = true;
  55. this.GameRanking.getComponent('GameRanking').OnActive();
  56. },
  57. OnRankingClose(event, customEventData)
  58. {
  59. this.GameRanking.active = false;
  60. },
  61. });