437 子 【方案】方案预设 / 【方案】方案预设-客户端
| | |
| | | |
| | | funPresetBtn.AddListener(()=> |
| | | { |
| | | FuncPresetManager.Instance.ClickBattlePreset((int)BattlePreSetType.Arena); |
| | | FuncPresetManager.Instance.ClickBattlePreset((int)BattlePreSetType.Story); |
| | | }); |
| | | |
| | | } |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | | public class ArenaWin : UIBase |
| | | { |
| | |
| | | [SerializeField] ScrollerController scrollerController; |
| | | [SerializeField] ArenaPlayerRankCell myRankCell; |
| | | [SerializeField] ArenaChallengeVoucher voucher; |
| | | [SerializeField] Button funPresetBtn; |
| | | |
| | | [HideInInspector] public int groupValue1 = 0; //一般用于跨服 |
| | | [HideInInspector] public int groupValue2 = 0; //一般用于跨服 |
| | | [HideInInspector] public string valueFormat = "{0}"; |
| | |
| | | ArenaManager.Instance.SendArenaMatch(); |
| | | UIManager.Instance.OpenWindow<ArenaChallengeWin>(); |
| | | }); |
| | | // btnDeployTroops.SetListener(() => |
| | | // { |
| | | // HeroUIManager.Instance.selectTeamType = TeamManager.Instance.GetTeamID((int)BattlePreSetType.Arena); |
| | | // UIManager.Instance.OpenWindow<HeroPosWin>(1); // 竞技场标签页 |
| | | // }); |
| | | funPresetBtn.AddListener(()=> |
| | | { |
| | | FuncPresetManager.Instance.ClickBattlePreset((int)BattlePreSetType.Arena); |
| | | }); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | RankModel.Instance.ResetQueryParam(); |
| | | RankModel.Instance.QueryRankByPage(ArenaManager.Instance.rankType, watchID: (int)PlayerDatas.Instance.baseData.PlayerID); |
| | | rpChallage.redpointId = ArenaManager.Instance.GetRedPonitId(1); |
| | | |
| | | } |
| | | |
| | | protected override void NextFrameAfterOpen() |
| | |
| | | DisplayMyRank(); |
| | | DisplayTop3(); |
| | | DisplayDeployTroop(); |
| | | |
| | | funPresetBtn.SetActive(FuncPresetManager.Instance.IsPreShow()); |
| | | } |
| | | |
| | | void CreateScroller() |
| | |
| | | |
| | | [SerializeField] FuncPresetChooseCells pareant; |
| | | |
| | | |
| | | int curBattleType; |
| | | public void Display(int battleType, int funcType, int id, bool isUnFold) |
| | | { |
| | | curBattleType = battleType; |
| | | var data = FuncPresetManager.Instance.GetFuncPreset(funcType, id); |
| | | if (data == null) |
| | | { |
| | |
| | | } |
| | | if (pareant.unFoldID == id) |
| | | { |
| | | FuncPresetManager.Instance.OnSelectPresetEvent?.Invoke(funcType, id, true); |
| | | FuncPresetManager.Instance.OnSelectPresetEvent?.Invoke(curBattleType, funcType, id, true); |
| | | } |
| | | else |
| | | { |
| | |
| | | void Fold(int funcType, int id) |
| | | { |
| | | pareant.unFoldID = 0; |
| | | FuncPresetManager.Instance.OnSelectPresetEvent?.Invoke(funcType, id, false); |
| | | FuncPresetManager.Instance.OnSelectPresetEvent?.Invoke(curBattleType, funcType, id, false); |
| | | } |
| | | |
| | | |
| | |
| | | bool forceUnFold = false; //强制展开,不能收缩; 流派界面的需求 |
| | | [NonSerialized] public int unFoldID = 0; //当前展开的方案ID,在选中的情况下才生效 |
| | | int curBattleType; |
| | | int curFuncType; |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | forceUnFold = _forceUnFold; |
| | | curBattleType = battleType; |
| | | curFuncType = funcType; |
| | | |
| | | var selectID = FuncPresetManager.Instance.GetFuncPresetIDByBattleType(battleType, funcType); |
| | | var showCount = FuncPresetManager.Instance.GetShowFuncPresetCount(funcType); |
| | |
| | | FuncPresetManager.Instance.OnSelectPresetEvent -= OnSelectPresetEvent; |
| | | } |
| | | |
| | | void OnSelectPresetEvent(int funcType, int id, bool isUnFold) |
| | | void OnSelectPresetEvent(int battleType, int _funcType, int id, bool isUnFold) |
| | | { |
| | | Display(curBattleType, funcType, forceUnFold); |
| | | if (battleType != curBattleType || curFuncType != _funcType) |
| | | return; |
| | | Display(curBattleType, _funcType, forceUnFold); |
| | | } |
| | | |
| | | //默认是居中靠右 |
| | |
| | | |
| | | public int[] openConditions; //流派预设(也叫全局方案/战斗方案) 开启条件【开服第N天,主线通关X-Y,定军阁达到N层】 |
| | | |
| | | public Action<int, int, bool> OnSelectPresetEvent; //选择功能预设方案事件 功能类型 方案ID 是否展开 |
| | | public Action<int, int, int, bool> OnSelectPresetEvent; //选择功能预设方案事件 功能类型 方案ID 是否展开 |
| | | |
| | | public override void Init() |
| | | { |