|
@@ -1,6 +1,6 @@
|
|
|
import { _decorator, AudioClip, AudioSource, Component, Node, Size, Sprite, SpriteFrame, sys, UITransform, Vec3 } from 'cc';
|
|
|
import { game_run } from './game_run';
|
|
|
-import { attributes_data, LevelItemData, scene_item_data, task_data, ui_att_item, UserData, widget_item_data } from '../../data/data';
|
|
|
+import { attributes_data, LevelItemData, scene_item_data, sysMessage, task_data, ui_att_item, UserData, widget_item_data } from '../../data/data';
|
|
|
import { config } from '../config';
|
|
|
import { sceneManager } from './sceneManager';
|
|
|
import { control } from '../edit/control';
|
|
@@ -21,6 +21,7 @@ export class gameManager extends Component {
|
|
|
public static res_map:Map<string,SpriteFrame> = new Map()
|
|
|
public static mp3_cache:Map<string,AudioClip> = new Map()
|
|
|
private mLevelData:LevelItemData = null;
|
|
|
+ private static sys_data:sysMessage = null;
|
|
|
@property(sceneManager) mSceneManager:sceneManager = null;
|
|
|
protected start(): void {
|
|
|
gameManager.Singleton = this;
|
|
@@ -94,6 +95,15 @@ export class gameManager extends Component {
|
|
|
public getLevelData(){
|
|
|
return this.mLevelData;
|
|
|
}
|
|
|
+
|
|
|
+ public static setSysData(data:sysMessage){
|
|
|
+ gameManager.sys_data = data;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static getSysData(){
|
|
|
+ return gameManager.sys_data;
|
|
|
+ }
|
|
|
+
|
|
|
public static loadSceneMp3(){
|
|
|
|
|
|
}
|
|
@@ -134,15 +144,20 @@ export class gameManager extends Component {
|
|
|
this.onLaunch(()=>{
|
|
|
this.mCurSceneIndex++;
|
|
|
let not_scene = false;
|
|
|
- while(this.mGameData[this.mCurSceneIndex].is_child_scene){
|
|
|
- if(this.mCurSceneIndex<this.mGameData.length){
|
|
|
- this.mCurSceneIndex++;
|
|
|
- }else{
|
|
|
- not_scene = true;
|
|
|
- break;
|
|
|
+ if(this.mCurSceneIndex>=this.mGameData.length){
|
|
|
+ not_scene = true;
|
|
|
+ }else{
|
|
|
+ while(this.mGameData[this.mCurSceneIndex].is_child_scene){
|
|
|
+ if(this.mCurSceneIndex<this.mGameData.length){
|
|
|
+ this.mCurSceneIndex++;
|
|
|
+ }else{
|
|
|
+ not_scene = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
if(!not_scene){
|
|
|
this.startLevelGame()
|
|
|
}else{
|
|
@@ -246,6 +261,9 @@ export class gameManager extends Component {
|
|
|
this.scheduleOnce(()=>{
|
|
|
this.startGame()
|
|
|
},0.5)
|
|
|
+ if(gameManager.Singleton.getLevelData()){
|
|
|
+ this.mSceneManager.playMusic(this.mLevelData.piped_music,true)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public loadScene(pages: scene_item_data[],type:number){
|