using System; using UnityEngine; using System.Collections; using UnityEngine.UI; namespace YLBattle { /// /// /// partial class FightingManager : MonoSingleton { #region UI-BattleResult /// /// 战斗胜利特效界面 /// private void LateShowSuccessAniWindow() { this.ClearBattleData(); if (this.mLevelMode == 3) { this.ClearBattleBundle(); //Application.LoadLevel("TestForRuiBin"); return; } PanelHelper.Instance.ShowPanel("BUI_SuccessAniWindow", (GameObject panel) => { if (panel != null) { panel.GetComponent(); } }, null, -1, null, "/CameraManager/UICamera"); } /// /// 延迟显示战斗胜利界面 /// [Obsolete("旧代码清理, gwang 2020.4.20")] private void LateShowBattleSuccessWindow() { this.ClearBattleData(); //PanelHelper.Instance.ShowPanel("UI_BattleWinWindow", (GameObject obj) => // { // //需要传关卡id,难度,星数和队伍列表 // obj.GetComponent().Init(this.mCarbonId, this.mGateId, this.mLevelDif, this.mStar, this.mHeros, this.mBuyBuffGold, // () => // { // this.ClearBattleBundle(); // });////最后这个0,是购买buffer费的金币数.请按实际值填入. //}, null, -1, null, "/CameraManager/UICamera"); } /// /// 战斗失败特效界面 /// private void LateShowFailAniWindow() { this.ClearBattleData(); if (this.mLevelMode == 3) { this.ClearBattleBundle(); //Application.LoadLevel("TestForRuiBin"); return; } PanelHelper.Instance.ShowPanel("BUI_FailAniWindow", (GameObject panel) => { if (panel != null) { panel.GetComponent(); } }, null, -1, null, "/CameraManager/UICamera"); } /// /// 延迟显示战斗失败窗口 /// [Obsolete("旧代码, gwang 2020.4.20")] private void LateShowBattleFailWindow() { this.ClearBattleData(); //// 开启战斗失败窗口 //PanelHelper.Instance.ShowPanel("UI_BattleFailWindow", (GameObject panel) => // { // //传两个参数,关卡id,和关卡难度 // panel.GetComponent().Init(this.mGateId, this.mLevelDif, this.mBuyBuffGold, () => // { // this.ClearBattleBundle(); // });////最后这个0,是购买buffer费的金币数.请按实际值填入. //}, null, -1, null, "/CameraManager/UICamera"); } /// /// 延迟显示战斗胜利界面 /// [Obsolete("旧代码,gwang 2020.4.20")] private void LateShowBattleForeverSuccessWindow() { this.ClearBattleData(); //PanelHelper.Instance.ShowPanel("UI_BattleForeverWinWindow", (GameObject obj) => // { // this.ClearBattleBundle(); // //需要传关卡id,难度,星数和队伍列表 // obj.GetComponent().InitPanel(this.mGateId, this.mLevelDif, this.mHeros, this.mBuyBuffGold, this.mLevelState, this.mBattleForever_leaveState);////最后这个0,是购买buffer费的金币数.请按实际值填入. //}, null, -1, null, "/CameraManager/UICamera"); } /// /// 延迟显示战斗失败窗口 /// [Obsolete("旧代码, gwang 2020年4月20日")] private void LateShowBattleForeverFailWindow() { this.ClearBattleData(); //// 开启战斗失败窗口 //PanelHelper.Instance.ShowPanel("UI_BattleForeverFailWindow", (GameObject panel) => //{ // this.ClearBattleBundle(); // //传两个参数,关卡id,和关卡难度 // panel.GetComponent().InitPanel(this.mGateId, this.mLevelDif, this.mHeros, this.mBuyBuffGold, this.mLevelState);////最后这个0,是购买buffer费的金币数.请按实际值填入. //}, null, -1, null, "/CameraManager/UICamera"); } /// /// 延迟显示战斗胜利界面 /// [Obsolete("2020.5.7 --gwang",true)] private void LateShowBattlePVPSuccessWindow() { //this.ClearBattleData(); ////传入值 ////this.mPvpPlayerUID ////this.mPvpType //PanelHelper.Instance.ShowPanel("UI_Pvp_BattleWinWindow", (GameObject obj) => // { // this.ClearBattleBundle(); // //需要传关卡id,难度,星数和队伍列表 // obj.GetComponent().InitPanel(this.mPvpPlayerUID, this.mPvpType);////最后这个0,是购买buffer费的金币数.请按实际值填入. //}, null, -1, null, "/CameraManager/UICamera"); } ///// ///// 延迟显示战斗失败窗口 ///// //private void LateShowBattlePVPFailWindow() //{ // this.ClearBattleData(); // //传入值 // //this.mPvpPlayerUID // //this.mPvpType // // 开启战斗失败窗口 // PanelHelper.Instance.ShowPanel("UI_Pvp_BattleFailWindow", (GameObject panel) => // { // this.ClearBattleBundle(); // //传两个参数,关卡id,和关卡难度 // panel.GetComponent().InitPanel(this.mPvpPlayerUID, this.mPvpType); // }, null, -1, null, "/CameraManager/UICamera"); //} #endregion #region Window /// /// 战斗暴击警示 /// /// who public void BattleBossWarning(string who) { //赋值并显示窗体 //BUI_BossTipWindow.Instance.SetData(mFighterTIDs[who], () => //{ // mBFM.ConfirmBattleWarningComplete(); // mBFM.OnManualCriticalFromUnity(who); //}); } /// /// 战斗必杀警示 /// /// who public void BattleCriticalWarning() { ///暴击提示窗体是由shader和animator组成的,如果是直接打开关系,则特效无法释放出来 ///所以这里需要从已加载的资源中克隆出一份儿新的~以激活特效 PanelHelper.Instance.ShowPanel("BUI_CriticalTipWindow", (GameObject panel) => { BUI_CriticalTipWindow tipScript = null; if (panel != null) { tipScript = panel.GetComponent(); //赋值并显示窗体 tipScript.SetData(() => { mBFM.ConfirmBattleCriticalTipComplete(); }); } }, null, -1, null, "/CameraManager/TipCamera"); } /// /// 技能警示 /// /// who public void BattleSkillTip(string who, string skillid) { Fighter fighter = null; if (mFighterList.ContainsKey(who)) { fighter = mFighterList[who]; } PanelHelper.Instance.ShowPanel("BUI_SkillTipWindow", (GameObject panel) => { BUI_SkillTipWindow tipScript = null; if (panel != null) { tipScript = panel.GetComponent(); //赋值并显示窗体 tipScript.SetData(fighter, skillid, () => { mBFM.ConfirmBattleSkillComplete(); mBFM.OnCastBullet(fighter.mID, skillid, "", true); }); } }, null, -1, null, "/CameraManager/TipCamera"); } #endregion #region UI-INFO /// /// 伤害提示 /// /// /// /// 显示位置 0=角色位置 1=屏幕中间 internal void BattleDamageInfo(string who, EBattleTips type, string val, float tipdelay = 0, int showStyle = 0) { if (mFighterList.ContainsKey(who)) { BUI_DamageManager.Instance.AddDamageTips(mFighterList[who].mTeam, who, type, val, tipdelay, showStyle); } else { if (type == EBattleTips.EDAMAGE_TIPS_NONE) { BUI_DamageManager.Instance.AddDamageTips(EBattleTeam.NONE, who, EBattleTips.EDAMAGE_TIPS, "资源加载错误"); } } } /// /// 刷新teamHp,teamPower /// public void OnRefreshWindowData() { BUI_ButtomUIWindow.Instance.SetHpValue(this.mBFM.GetTeamHp(EBattleTeam.BLUETEAM)); BUI_TopUIWindow.Instance.SetHpValue(this.mBFM.GetTeamHp(EBattleTeam.REDTEAM)); } /// /// /// /// public void OnSetBossDescriptionWindow(string _bossID, bool isShow) { if (!isShow) { BUI_BossDescriptionWindow.Instance.Hide(); return; } PanelHelper.Instance.ShowPanel("BUI_BossDescriptionWindow", (GameObject panel) => { if (panel != null) { panel.GetComponent().SetData(this.mFighterList[_bossID].mTID, this.mFighterList[_bossID].mLevel, () => { this.mBFM.ConfirmBossDescriptionClickTrigger(); this.OnOverMapBossEffect(); }); } }, null, -1, null, "/CameraManager/UICamera"); } /// /// 显示敌方技能提示 /// /// /// public void OnShowEnemySkillTip(string who, string _strSkill) { Fighter fighter = null; if (mFighterList.ContainsKey(who)) { fighter = mFighterList[who]; } BUI_BossSkillTip.Instance.SetData(fighter, _strSkill, () => { this.mBFM.ConfirmBattleBossSkillComplete(who, _strSkill); }); } /// /// 打开地图配合boss出场效果 /// public void OnStartMapBossEffect() { FightingMap.Instance.StartMapBossEffect(); } /// /// 结束地图配合boss出场效果 /// public void OnOverMapBossEffect() { FightingMap.Instance.OverMapBossEffect(); } /// /// 开始战斗 /// /// 是否2倍速度 public void OnOprStateSetting(bool bolSecSpeed) { BUI_TopBtnWindow.Instance.SetData(bolSecSpeed, this.mGateId, this.mLevelDif); } /// /// Prewar-> 播放开战动画 /// public void OnPlayBattleStartAnimation() { SkillControl.Instance.createUIScreenEffect("UI_SKILL_kaishizhandou", "UI_SKILL_kaishizhandou"); AudioManager.Instance.PlayUISoundEffect(AudioManager.BattleSepcial_StartFightSound); } /// /// Prewar-> 播放开战动画 /// public void OnPlayLevelEffect() { BUI_TopUIWindow.Instance.SetLevelData(this.mLevelName, this.mLevelState + 1, this.mLevelTotal, this.mLevelMode); } /// /// 替换指定占位的角色 /// /// 位置索引 /// serverIID public void OnUpdateSlotData(int _seat, string _serveriid) { BUI_FighterUIWindow.Instance.UpdateSlotData(_seat, _serveriid); } /// /// 设置场景UI操作状态 /// /// 是否可点击释放技能 /// 是否可点击双倍速按钮 public void OnSetBattleUIOperate(bool _bolSkillUI, bool _bolTopBtn) { //Debug.LogError("Opr " + _bolSkillUI + "............................"); BUI_FighterUIWindow.Instance.SetLockedState(_bolSkillUI); BUI_TopBtnWindow.Instance.SetLockedState(_bolTopBtn); } /// /// /// /// public void OnBossArrival(string iid) { //BUI_TopUIWindow.Instance.SetBoss(iid); } /// /// 隐藏战斗UI /// (战斗开始,boss开始出场) /// public void OnHideBattleUI() { BUI_TopUIWindow.Instance.SetShow(false); BUI_TopBtnWindow.Instance.SetShow(false); BUI_ButtomUIWindow.Instance.SetShow(false); BUI_FighterUIWindow.Instance.SetShow(false); } /// /// 显示战斗UI /// ( boss结束出场 ) /// public void OnShowBattleUI() { BUI_TopUIWindow.Instance.SetShow(true); BUI_TopBtnWindow.Instance.SetShow(true); BUI_ButtomUIWindow.Instance.SetShow(true); BUI_FighterUIWindow.Instance.SetShow(true); } /// /// 好友支援提示 /// public void OnFriendSupportTip(string friendtid) { //PanelHelper.Instance.ShowPanel("BUI_FriendSupportWindow", "/CameraManager/TipCamera", (GameObject panel) => //{ // if (panel != null) // { // panel.GetComponent().Open(friendtid); // } //}); } #endregion } }