| 123456789101112131415161718192021222324252627282930313233343536 |
- cc.Class({
- extends: require("BaseGameStates"),
- properties: {
- Player_infoArr: {
- default: [],
- type: cc.Label,
- }
- },
- onLoad() {
- // this.InformationChanges("set", "name", "小明");
- //let name = this.InformationChanges("get", "name");
- // console.log(a);
- this.InformationChanges("set", 0, "小明");
- this.InformationChanges("set", 1, 50);
- this.InformationChanges("set", 2, 50);
- },
- start() {
- for (let i = 0; i < this.Player_infoArr.length; i++) {
- let info = this.InformationChanges("get", i);
- if (i == 1 || i == 2) {
- if (info / 1000 > 1) {
- this.Player_infoArr[i].string = info / 1000 + "K";
- } else {
- this.Player_infoArr[i].string = info;
- }
- } else {
- this.Player_infoArr[i].string = info;
- }
- }
- },
- // update (dt) {},
- });
|