|
@@ -71,6 +71,36 @@ export class GameManager extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 获取游戏结束提示索引
|
|
|
+ public static getGameEndPrompt(score:number):number {
|
|
|
+ let cur_index = -1
|
|
|
+ let list = tools.sys_config.game_end_prompt
|
|
|
+ for (let index = 0; index < list.length; index++) {
|
|
|
+ const element = list[index];
|
|
|
+ if(typeof element === "string") {
|
|
|
+ let arr = element.split('_')
|
|
|
+ if(arr.length == 2) {
|
|
|
+ let start_num = Number(arr[0])
|
|
|
+ let end_num = Number(arr[1])
|
|
|
+ // console.log('start_num=',start_num,'end_num=',end_num)
|
|
|
+ if(list.length-1==index) { //最后一个只判断开始值
|
|
|
+ if(score>=start_num) {
|
|
|
+ cur_index = index
|
|
|
+ break
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(score>=start_num&&score<=end_num) {
|
|
|
+ cur_index = index
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log('cur_index=',cur_index)
|
|
|
+ return cur_index
|
|
|
+ }
|
|
|
+
|
|
|
// 设置
|
|
|
public static getSettingData():settingData {
|
|
|
if(GameManager.settingData!=null) {
|