cc.Class({ extends: cc.Component, properties: { }, onLoad() { this.restTime = 12; this.currentTime = 0; this.player_name = ""; this.player_gold = 10000; this.player_energy = 10001; this.player_sex = 0; }, start() { }, update(dt) { }, InformationChanges(state, indel, info) { if (state == "set") { if (indel == 0) { this.player_name = info; } if (indel == 1) { this.player_gold = info; } if (indel == 2) { this.player_energy = info; } if (indel == 3) { this.player_sex = info; } } else if (state == "get") { if (indel == 0) { return this.player_name; } if (indel == 1) { return this.player_gold; } if (indel == 2) { return this.player_energy; } if (indel == 3) { return this.player_sex; } } }, //时间减少 countdown(currentTime) { currentTime--; if (currentTime <= 0) { currentTime = 0; } return currentTime; }, });