| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- cc.Class({
- extends: require("BaseGameStates"),
- properties: {
- Player_infoArr: {
- default: [],
- type: cc.Label,
- },
- },
- onLoad() {
- this._super();
- this._restTime = this.restTime;
- this._currentTime = this.currentTime;
- this._player_name = this.player_name;
- this._player_gold = this.player_gold;
- this._player_energy = this.player_energy;
- this._player_sex = this.player_sex;
- this._currPass = this.currPass; //当前关卡
- //#region
- // 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);
- //#endregion
- 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 = parseInt(info / 1000) + "K";
- } else {
- this.Player_infoArr[i].string = info;
- }
- } else {
- this.Player_infoArr[i].string = info;
- }
- }
- },
- start() {
- //console.log("金币", this.player_gold);
- },
- update(dt) {
- },
- init() {
- //角色脚本
- },
- });
|