//开始一场战斗 static public bool TryBattle(int battleId) { if (isQuickBattle) { return(ShowYesOrNoSelectPanel("是否战斗胜利?")); } bool isWin = false; RunInMainThrad(() => { var pos = LevelMaster.Instance.GetPlayerPosition(); string posStr = UnityTools.Vector3ToString(pos); string currentScene = SceneManager.GetActiveScene().name; LevelLoader.LoadBattle(battleId, (ret) => { LevelLoader.LoadGameMap(ConfigTable.Get <GameMap>(currentScene), new LevelMaster.LevelLoadPara() { loadType = LevelMaster.LevelLoadPara.LevelLoadType.StartAtPos, CurrentPos = posStr }, "", () => { isWin = (ret == BattleFieldModel.BattleResult.Win); Next(); }); }); }); Wait(); return(isWin); }
private void DisplayCastEft() { var display = GetDisplay(); //播放特效 Jyx2ResourceHelper.LoadPrefab(display.CastEft, prefab => { var duration = HSUnityTools.ParticleSystemLength(prefab.transform); Vector3 offset = Vector3.zero; if (!string.IsNullOrEmpty(display.CastOffset)) { offset = UnityTools.StringToVector3(display.CastOffset, ','); } CastEffectAndWaitSkill(prefab, duration, Source.gameObject.transform, offset); //默认预留三秒 }); }
private void DisplayBlockEft() { var display = GetDisplay(); Jyx2ResourceHelper.LoadPrefab(display.BlockEft, prefab => { var blockEftDuration = HSUnityTools.ParticleSystemLength(prefab.transform); Vector3 offset = Vector3.zero; if (!string.IsNullOrEmpty(display.BlockOffset)) { offset = UnityTools.StringToVector3(display.BlockOffset, ','); } //播放特效 foreach (var block in CoverBlocks) { CastEffectAndWaitSkill(prefab, blockEftDuration, block, offset); } }); }