let gameConfig = require("GameConfig"); cc.Class({ extends: cc.Component, properties: { gameStates: { default: null, type: cc.Node, serializable: true, }, title: { default: null, type: cc.Label, serializable: true, }, }, onLoad() { this.gameStatesScp = this.gameStates.getComponent('GameStates'); let name = gameConfig.round[this.gameStatesScp.currentRound].name; this.title.string = (this.gameStatesScp.currentRound+1) + ',' + name; }, next() { if (this.gameStatesScp.currentRound == 23) return; this.gameStatesScp.currentRound++; let name = gameConfig.round[this.gameStatesScp.currentRound].name; this.title.string = (this.gameStatesScp.currentRound+1) + ',' + name; } });