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