BCBMPanelHistroy.js 552 B

12345678910111213141516171819202122
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. },
  5. showPanel(data) {
  6. let content = cc.find("rootNode/layer_content2", this.node);
  7. for (let i = 0; i < content.children.length; i += 1) {
  8. let label = content.children[i].getComponent(cc.Label);
  9. label.string = ((data[i] / data.totalRound).toFixed(4) * 100).toFixed(2) + "%";
  10. }
  11. this.node.active = true;
  12. },
  13. closePanel() {
  14. this.node.parent.BCBMAudioManager.playButton();
  15. this.node.active = false;
  16. },
  17. });