PlantInfo.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. //单价
  5. price: {
  6. default: null,
  7. type: cc.Label,
  8. serializable: true,
  9. },
  10. //成熟期
  11. maturity: {
  12. default: null,
  13. type: cc.Label,
  14. serializable: true,
  15. },
  16. //种植时间
  17. plantStart: {
  18. default: null,
  19. type: cc.Label,
  20. serializable: true,
  21. },
  22. //收获数量
  23. harvestQuantity: {
  24. default: null,
  25. type: cc.Label,
  26. serializable: true,
  27. },
  28. //介绍
  29. describe: {
  30. default: null,
  31. type: cc.Label,
  32. serializable: true,
  33. },
  34. },
  35. // LIFE-CYCLE CALLBACKS:
  36. // onLoad () {},
  37. start () {
  38. },
  39. setInfo(price,maturity,plantStart,harvestQuantity,describe){
  40. this.price.string = price;
  41. this.maturity.string = maturity;
  42. this.plantStart.string = plantStart;
  43. this.harvestQuantity.string = harvestQuantity;
  44. this.describe.string = describe;
  45. },
  46. onclose(){
  47. }
  48. });