public override void Init(string additionalData) { base.Init(additionalData); //get battlemodule _battlefield = ModuleManager.getInstance.GetModule <BattleControllerModule>(); _inputModule = ModuleManager.getInstance.GetModule <BattlefieldInputModule>(); //_inputModule.onPressClick += OnInputClick; _highLightMat = this._object.GetComponentInChildren <SpriteRenderer>().material; _highlightID = Shader.PropertyToID(_highColorStr); _highLightMat.SetColor(_highlightID, HighColor); // _inputController = _object.GetComponent <InputController>(); if (_inputController == null) { _inputController = _object.AddComponent <InputController>(); } _inputController.onPressClick = OnInputClick; _inputController.onTouchEnter = OnTouchEnter; _inputController.onTouchExit = OnTouchExit; ToNormalLight(); }
IEnumerator LoadBattleScene(int level, int area) { yield return(0); var back = SceneManager.LoadSceneAsync("Battlefield"); while (!back.isDone) { yield return(0); } _battleLogicObject.onupdate += Update; //----------------- //----------------- // _battleModule = ModuleManager.getInstance.GetModule <BattlefieldModule>(); _battleModule.SelectLevel(area, level); ModuleManager.getInstance.StartModule <BattlefieldCameraModule>(); ModuleManager.getInstance.StartModule <BattlefieldInputModule>(); //UI mode 启动前置! ModuleManager.getInstance.StartModule <BattleUIModule>(); ModuleManager.getInstance.StartModule <BattleTurnsModule>(); ModuleManager.getInstance.StartModule <ShopUIModule>(); //masktile管理 ModuleManager.getInstance.StartModule <MaskTileModule>(); //此处载入关卡数据mapdata ModuleManager.getInstance.StartModule <BattlefieldModule>(); ModuleManager.getInstance.StartModule <RobotManagerModule>(); ModuleManager.getInstance.StartModule <StarredModule>(); _battleUIModule = ModuleManager.getInstance.GetModule <BattleUIModule>(); _battleInputModule = ModuleManager.getInstance.GetModule <BattlefieldInputModule>(); _robotManagerModule = ModuleManager.getInstance.GetModule <RobotManagerModule>(); _battleTurnsModule = ModuleManager.getInstance.GetModule <BattleTurnsModule>(); _shopUIModule = ModuleManager.getInstance.GetModule <ShopUIModule>(); _controllerModule = ModuleManager.getInstance.GetModule <BattleControllerModule>(); _starredModule = ModuleManager.getInstance.GetModule <StarredModule>(); //这里尝试载入一下道具 SaveLoader.getInstance.LoadPlayerCurItems(area); //加上mission回调 MissionManager.getInstance.OnMissionValueHandler += OnMissionValue; _battleTurnsModule.NextTurn(); }