| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- 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;
- this.game_time = 720; //战斗时间
- this.currPass = 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;
- },
- });
|