description import * as Framework from "../../framework/Framework" ; import { NetManager } from "./NetManager" ; import { LogicManager } from "./LogicManager" ; import GlobalAudio from "../component/GlobalAudio" ; import { Log , LogLevel } from "../../framework/log/Log" ; import { extentionsInit } from "../../framework/extentions/Extentions" ; import { CocosExtentionInit } from "../../framework/extentions/CocosExtention" ; import { LanguageImpl } from "../language/LanguageImpl" ; import { getSingleton } from "../../framework/base/Singleton" ; import { USING_LAN_KEY } from "../../framework/base/Defines" ; import GameView from "../base/GameView" ; import { GameData } from "../base/GameData" ; import { GameManager } from "./GameManager" ; import Tips from "../component/Tips" ; import UILoading from "../component/UILoading" ; import Alert from "../component/Alert" ; class _Manager extends Framework . _FramewokManager { description get netManager ( ) { return getSingleton ( NetManager ) ; } description get logicManager ( ) { return getSingleton ( LogicManager ) ; } description get gameManager ( ) { return getSingleton ( GameManager ) ; } description get alert ( ) { return getSingleton ( Alert ) ; } description private _globalAudio : GlobalAudio = null ; get globalAudio ( ) { if ( this . _globalAudio ) { return this . _globalAudio ; } this . _globalAudio = this . uiManager . getCanvas ( ) . getComponent ( GlobalAudio ) ; return this . _globalAudio ; } description gameView : GameView = null ; description gameData : GameData = null ; description example gameController : any = null ; description param param param isUsingAssetBundle example makeLanguage ( param , isUsingAssetBundle = false ) { if ( typeof param == "string" ) { if ( isUsingAssetBundle && this . gameData ) { return `${ USING_LAN_KEY }${ this . gameData . bundle }.${ param }` ; } return `${ USING_LAN_KEY }${ param }` ; } if ( typeof param [ 0 ] == "string" && param instanceof Array ) { if ( isUsingAssetBundle && this . gameData ) { param [ 0 ] = `${ USING_LAN_KEY }${ this . gameData . bundle }.${ param [ 0 ] }` ; } else { param [ 0 ] = `${ USING_LAN_KEY }${ param [ 0 ] }` ; } } return param ; } init ( ) { Log . logLevel = LogLevel . ERROR | LogLevel . LOG | LogLevel . WARN | LogLevel . DUMP ; description Framework . Manager . tips = getSingleton ( Tips ) ; description this . tips = Framework . Manager . tips ; description Framework . Manager . uiLoading = getSingleton ( UILoading ) ; this . uiLoading = Framework . Manager . uiLoading ; this . resolutionHelper . initBrowserAdaptor ( ) ; extentionsInit ( ) ; CocosExtentionInit ( ) ; this . language . delegate = getSingleton ( LanguageImpl ) ; } } export const Manager = new _Manager ( ) ;