| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- cc.Class({
- extends: cc.Component,
- properties: {
- },
- onLoad() {
- this.restTime = 0;
- this.currentTime = 0;
- this.player_name = "";
- this.player_gold = 0;
- this.player_energy = 0;
- this.player_sex = 0;
- },
- start() {
- this.InformationChanges("set", 0, "AFHRFS");
- this.InformationChanges("set", 1, 50);
- this.InformationChanges("set", 2, 50);
- },
- // 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;
- }
- }
- }
- });
|