GameConfig.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. BDebug: {
  5. default: true,
  6. serializable: true,
  7. },
  8. },
  9. onLoad () {
  10. this.Host = 'https://www.9527fun.cn/Idol/';
  11. this.ActionPower = 0;
  12. this.Golden = 0;
  13. this.Diamond = 0;
  14. this.Fans=0;
  15. this.FavorableImpression=0;
  16. //Course
  17. this.TalentTotalTime = 0;
  18. this.MakeUpTotalTime = 0;
  19. this.EloquenceTotalTime = 0;
  20. this.FashionTotalTime = 0;
  21. this.DanceTotalTime = 0;
  22. //Event
  23. this.VarietyShowTotalTime = 0;
  24. this.InterviewTotalTime = 0;
  25. this.MovieTotalTime = 0;
  26. this.HangOutTotalTime = 0;
  27. this.GirlAnimations = ['Idle'];
  28. },
  29. GetGameConfig(CallBack)
  30. {
  31. // let URL = this.Host+'GameConfig/GetGameConfig';
  32. // let XHR = new XMLHttpRequest();
  33. //
  34. // XHR.onreadystatechange = function () {
  35. // if (XHR.readyState == 4 && (XHR.status >= 200 && XHR.status < 400)) {
  36. // let response = XHR.responseText;
  37. // // console.log(response);
  38. // let ResultJson = JSON.parse(response);
  39. // // console.log(ResultJson);
  40. //
  41. // // Game
  42. // let GameConfig = ResultJson.GameConfig;
  43. // // console.log(GameConfig);
  44. // this.ActionPower = GameConfig.ActionPower;
  45. // this.Coin = GameConfig.Coin;
  46. // this.Diamond = GameConfig.Diamond;
  47. // this.Fans=GameConfig.Fans;
  48. // this.FavorableImpression=GameConfig.FavorableImpression;
  49. //
  50. // // Course
  51. // let CourseConfig = ResultJson.CourseConfig;
  52. // // console.log(CourseConfig);
  53. // this.TalentTotalTime = CourseConfig.TalentTotalTime;
  54. // this.MakeUpTotalTime = CourseConfig.MakeUpTotalTime;
  55. // this.EloquenceTotalTime = CourseConfig.EloquenceTotalTime;
  56. // this.FashionTotalTime = CourseConfig.FashionTotalTime;
  57. // this.DanceTotalTime = CourseConfig.DanceTotalTime;
  58. //
  59. // //Event
  60. // let EventConfig = ResultJson.EventConfig;
  61. // this.VarietyShowTotalTime = EventConfig.VarietyShowTotalTime;
  62. // this.InterviewTotalTime = EventConfig.InterviewTotalTime;
  63. // this.MovieTotalTime = EventConfig.MovieTotalTime;
  64. // this.HangOutTotalTime = EventConfig.HangOutTotalTime;
  65. //
  66. // CallBack();
  67. // }
  68. // }.bind(this);
  69. // XHR.open("GET", URL, true);
  70. // XHR.setRequestHeader("Content-Type" , "application/json");
  71. // XHR.send();
  72. }
  73. });